Package logilab :: Package common :: Module logging_ext
[frames] | no frames]

Module logging_ext

source code

Extends the logging module from the standard library.

:copyright: 2000-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
:license: General Public License version 2 - http://www.gnu.org/licenses

Classes
  ColorFormatter
A color Formatter for the logging standard module.
Functions
 
init_log(debug=False, syslog=False, logthreshold=None, logfile=None, logformat='%(asctime)s - (%(name)s) %(levelname)s: %(message)s', logdateformat='%Y-%m-%d %H:%M:%S')
init the log service
source code
 
set_color_formatter(logger=None, **kw)
Install a color formatter on the 'logger'.
source code
 
set_log_methods(cls, logger)
bind standard logger's methods as methods on the class
source code
 
xxx_cyan(record) source code
Variables
  LOG_DATE_FORMAT = '%Y-%m-%d %H:%M:%S'
  LOG_FORMAT = '%(asctime)s - (%(name)s) %(levelname)s: %(messag...
  THRESHOLD_MAP = {'LOG_CRIT': 'CRITICAL', 'LOG_DEBUG': 'DEBUG',...
  __package__ = 'logilab.common'
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_CRIT': 'CRITICAL',
 'LOG_DEBUG': 'DEBUG',
 'LOG_ERR': 'ERROR',
 'LOG_ERROR': 'ERROR',
 'LOG_INFO': 'INFO',
 'LOG_NOTICE': 'INFO',
 'LOG_WARN': 'WARNING',
 'LOG_WARNING': 'WARNING'}