Package logilab :: Package common :: Module logging_ext

[frames] | no frames]

# Module logging_ext

source code

    Extends the logging module from the standard library.

Classes
| ColorFormatter A color Formatter for the logging standard module.

Functions

set_log_methods(cls, logger) bind standard logger's methods as methods on the class | source code

xxx_cyan(record) | source code

set_color_formatter(logger=None, **kw) Install a color formatter on the 'logger'. | source code

get_handler(debug=False, syslog=False, logfile=None, rotation_parameters=None) get an apropriate handler according to given parameters | source code

get_threshold(debug=False, logthreshold=None) | source code

get_formatter(logformat=LOG_FORMAT, logdateformat=LOG_DATE_FORMAT) | source code

init_log(debug=False, syslog=False, logthreshold=None, logfile=None, logformat=LOG_FORMAT, logdateformat=LOG_DATE_FORMAT, fmt=None, rotation_parameters=None, handler=None) init the log service | source code

Variables
| LOG_FORMAT = `'%(asctime)s - (%(name)s) %(levelname)s: %(messag`...``
| LOG_DATE_FORMAT = `'%Y-%m-%d %H:%M:%S'`
| THRESHOLD_MAP = `{'LOG_DEBUG': 'DEBUG', 'LOG_INFO': 'INFO', 'LO`...``

Function Details

### set_color_formatter(logger=None, **kw)

source code

    Install a color formatter on the 'logger'. If not given, it will
    defaults to the default logger.

    Any additional keyword will be passed as-is to the ColorFormatter
    constructor.

Variables Details

### LOG_FORMAT

Value:

      '%(asctime)s - (%(name)s) %(levelname)s: %(message)s'

### THRESHOLD_MAP

Value:

      {'LOG_DEBUG': 'DEBUG', 'LOG_INFO': 'INFO', 'LOG_NOTICE': 'INFO', 'LOG_
      WARN': 'WARNING', 'LOG_WARNING': 'WARNING', 'LOG_ERR': 'ERROR', 'LOG_E
      RROR': 'ERROR', 'LOG_CRIT': 'CRITICAL',}