logging#

Configure logging for conda.

Classes#

TokenURLFilter

Filter instances are used to perform arbitrary filtering of LogRecords.

StdStreamHandler

Log StreamHandler that always writes to the current sys stream.

Functions#

initialize_logging()

initialize_std_loggers()

set_conda_log_level([level])

set_all_logger_level([level])

set_file_logging([logger_name, level, path])

set_verbosity(verbosity)

set_log_level(log_level)

trace(self, message, *args, **kwargs)

Attributes#

_VERBOSITY_LEVELS#
class TokenURLFilter(name='')#

Bases: logging.Filter

Filter instances are used to perform arbitrary filtering of LogRecords.

Loggers and Handlers can optionally use Filter instances to filter records as desired. The base filter class only allows events which are below a certain point in the logger hierarchy. For example, a filter initialized with "A.B" will allow events logged by loggers "A.B", "A.B.C", "A.B.C.D", "A.B.D" etc. but not "A.BB", "B.A.B" etc. If initialized with the empty string, all events are passed.

TOKEN_URL_PATTERN#
TOKEN_REPLACE#
filter(record)#

Since Python 2's getMessage() is incapable of handling any strings that are not unicode when it interpolates the message with the arguments, we fix that here by doing it ourselves.

At the same time we replace tokens in the arguments which was not happening until now.

class StdStreamHandler(sys_stream)#

Bases: logging.StreamHandler

Log StreamHandler that always writes to the current sys stream.

terminator = '\n'#
__getattr__(attr)#
emit(record)#

Emit a record.

If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline. If exception information is present, it is formatted using traceback.print_exception and appended to the stream. If the stream has an 'encoding' attribute, it is used to determine how to do the output to the stream.

initialize_logging()#
initialize_std_loggers()#
set_conda_log_level(level=WARN)#
set_all_logger_level(level=DEBUG)#
set_file_logging(logger_name=None, level=DEBUG, path=None)#
set_verbosity(verbosity: int)#
set_log_level(log_level: int)#
trace(self, message, *args, **kwargs)#