bittensor.btlogging#

Standardized logging for Bittensor.

Module Contents#

Classes#

logging

Standardized logging for Bittensor.

Functions#

_remove_loguru_ansi_directive(text)

Attributes#

logger

bittensor.btlogging._remove_loguru_ansi_directive(text)#
Parameters:

text (str) –

Return type:

str

bittensor.btlogging.logger#
class bittensor.btlogging.logging#

Standardized logging for Bittensor.

__debug_on__: bool = False#
__file_sink__: int#
__has_been_inited__: bool = False#
__std_sink__: int#
__trace_on__: bool = False#
classmethod _format(prefix, sufix=None)#

Format logging message

Parameters:
classmethod add_args(parser, prefix=None)#

Accept specific arguments fro parser

Parameters:
classmethod check_config(config)#

Check config

Parameters:

config (bittensor.config) –

classmethod config()#

Get config from the argument parser.

Returns:

bittensor.config object

classmethod debug(prefix, sufix=None)#

Info logging

Parameters:
classmethod error(prefix, sufix=None)#

Error logging

Parameters:
classmethod exception(prefix, sufix=None)#

Exception logging with traceback

Parameters:
classmethod get_level()#
Return type:

int

classmethod help()#

Print help to stdout

classmethod info(prefix, sufix=None)#

Info logging

Parameters:
classmethod log_filter(record)#

Filter out debug log if debug is not on

classmethod log_formatter(record)#

Log with different format according to record[‘extra’]

classmethod log_save_filter(record)#
classmethod log_save_formatter(record)#
classmethod set_debug(debug_on=True)#

Set debug for the specific cls class

Parameters:

debug_on (bool) –

classmethod set_trace(trace_on=True)#

Set trace back for the specific cls class

Parameters:

trace_on (bool) –

classmethod success(prefix, sufix=None)#

Success logging

Parameters:
classmethod trace(prefix, sufix=None)#

Info logging

Parameters:
classmethod warning(prefix, sufix=None)#

Warning logging

Parameters: