bittensor.utils.btlogging.helpers#

btlogging.helpers module provides helper functions for the Bittensor logging system.

Functions#

all_logger_names()

Generate the names of all active loggers.

all_loggers()

Generator that yields all logger instances in the application.

get_max_logger_name_length()

Calculate and return the length of the longest logger name.

Module Contents#

bittensor.utils.btlogging.helpers.all_logger_names()[source]#

Generate the names of all active loggers.

This function iterates through the logging root manager’s logger dictionary and yields the names of all active Logger instances. It skips placeholders and other types that are not instances of Logger.

Yields:

name (str) – The name of an active logger.

Return type:

Generator[str, None, None]

bittensor.utils.btlogging.helpers.all_loggers()[source]#

Generator that yields all logger instances in the application.

Iterates through the logging root manager’s logger dictionary and yields all active Logger instances. It skips placeholders and other types that are not instances of Logger.

Yields:

logger (logging.Logger) – An active logger instance.

Return type:

Generator[logging.Logger, None, None]

bittensor.utils.btlogging.helpers.get_max_logger_name_length()[source]#

Calculate and return the length of the longest logger name.

This function iterates through all active logger names and determines the length of the longest name.

Returns:

The length of the longest logger name.

Return type:

max_length (int)