Skip to content

BittensorConsole class#2446

Merged
basfroman merged 8 commits intostagingfrom
feat/roman/bittensor-console
Nov 20, 2024
Merged

BittensorConsole class#2446
basfroman merged 8 commits intostagingfrom
feat/roman/bittensor-console

Conversation

@basfroman
Copy link
Collaborator

blogging gets a new console field. It appears immediately during LoggingMachine instance is initialization.
BittensorConsole methods allow you to output messages to the terminal/console without changing the logging level of the main logging (btlogging).

Usage example:

from bittensor import logging

# will be logged
logging.console.info("info message")
logging.console.error("error message")
logging.console.success("success message")
logging.console.warning("warning message")
 logging.console.critical("critical message")

# will not be logged
logging.info("test info")

@basfroman basfroman requested a review from a team November 20, 2024 09:22
@basfroman basfroman self-assigned this Nov 20, 2024
@basfroman basfroman added enhancement New feature or request feature new feature added bittensor do not merge labels Nov 20, 2024
Copy link
Contributor

@thewhaleking thewhaleking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale for adding this?

@basfroman
Copy link
Collaborator Author

BittensorConsole

By default, SDK has a warning logging level. Any messages of a lower level will not be displayed. Sometimes we need to display messages (as we did it with rich.console), but the user will not see it. BittensorConsole allows you to display messages of any level without explicitly changing them. The difference from "print" is that we can use color and emoji support, since BittensorConsole is based on blogging.

Roman added 4 commits November 20, 2024 10:06
thewhaleking
thewhaleking previously approved these changes Nov 20, 2024
@basfroman basfroman merged commit bab874c into staging Nov 20, 2024
@thewhaleking thewhaleking deleted the feat/roman/bittensor-console branch November 20, 2024 20:54
@ibraheem-abe ibraheem-abe mentioned this pull request Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bittensor enhancement New feature or request feature new feature added

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants