utils.log

Logging utilities.

Module Contents

Classes

ColorFormatter(self,fmt=None,use_color=True) Logging formatter that adds colors based on severity.
LoggingProxy(self,logger,loglevel=None) Forward file object to logging.Logger instance.

Functions

set_in_sighandler(value) Set flag signifiying that we’re inside a signal handler.
iter_open_logger_fds()
in_sighandler() Context that records that we are in a signal handler.
logger_isa(l,p,max=1000)
_using_logger_parent(parent_logger,logger_)
get_logger(name) Get logger by name.
get_task_logger(name) Get logger for task module by name.
mlevel(level) Convert level name/int to log level.
get_multiprocessing_logger() Return the multiprocessing logger.
reset_multiprocessing_logger() Reset multiprocessing logging setup.
current_process()
current_process_index(base=1)
set_in_sighandler(value)

Set flag signifiying that we’re inside a signal handler.

iter_open_logger_fds()
in_sighandler()

Context that records that we are in a signal handler.

logger_isa(l, p, max=1000)
_using_logger_parent(parent_logger, logger_)
get_logger(name)

Get logger by name.

get_task_logger(name)

Get logger for task module by name.

mlevel(level)

Convert level name/int to log level.

class ColorFormatter(fmt=None, use_color=True)

Logging formatter that adds colors based on severity.

__init__(fmt=None, use_color=True)
formatException(ei)
format(record)
class LoggingProxy(logger, loglevel=None)

Forward file object to logging.Logger instance.

Arguments:
logger (~logging.Logger): Logger instance to forward to. loglevel (int, str): Log level to use when logging messages.
__init__(logger, loglevel=None)
_safewrap_handlers()
write(data)

Write message to logging object.

writelines(sequence)

Write list of strings to file.

The sequence can be any iterable object producing strings. This is equivalent to calling write() for each string.

flush()
close()
isatty()

Here for file support.

get_multiprocessing_logger()

Return the multiprocessing logger.

reset_multiprocessing_logger()

Reset multiprocessing logging setup.

current_process()
current_process_index(base=1)