Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BittensorConsole class #2446

Merged
merged 8 commits into from
Nov 20, 2024
Merged

Conversation

roman-opentensor
Copy link
Contributor

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")

@roman-opentensor roman-opentensor requested a review from a team November 20, 2024 09:22
@roman-opentensor roman-opentensor self-assigned this Nov 20, 2024
@roman-opentensor roman-opentensor 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?

@roman-opentensor
Copy link
Contributor 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.

thewhaleking
thewhaleking previously approved these changes Nov 20, 2024
@roman-opentensor roman-opentensor merged commit bab874c into staging Nov 20, 2024
23 checks passed
@thewhaleking thewhaleking deleted the feat/roman/bittensor-console branch November 20, 2024 20:54
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