noc.core.log

Module Contents

class noc.core.log.PrefixLoggerAdapter(logger, prefix, target=None)

Bases: object

Add [prefix] to log message

set_prefix(self, prefix)
_log(self, level, msg, args, **kwargs)
debug(self, msg, *args, **kwargs)
info(self, msg, *args, **kwargs)
warning(self, msg, *args, **kwargs)
error(self, msg, *args, **kwargs)
critical(self, msg, *args, **kwargs)
exception(self, msg, *args, **kwargs)
isEnabledFor(self, level)

See if the underlying logger is enabled for the specified level.

get_logger(self, prefix)

Returns new logger adapter with additional prefix

class noc.core.log.ColorFormatter(*args, **kwargs)

Bases: logging.Formatter

Colored terminal formatter

DEFAULT_LOG_COLORS
format(self, record)
setup_colors(self)

Set up terminal colors

class noc.core.log.ErrorFormatter

Bases: logging.Formatter

formatException(self, ei)