cement.ext.ext_colorlog

Cement colorlog extension module.

class cement.ext.ext_colorlog.ColorLogHandler(*args, **kw)[source]

Bases: cement.ext.ext_logging.LoggingLogHandler

This class implements the Log Handler interface. It is a sub-class of cement.ext.ext_logging.LoggingLogHandler which is based on the standard logging library, and adds colorized console output using the ColorLog library.

Note This extension has an external dependency on colorlog. You must include colorlog in your applications dependencies as Cement explicitly does not include external dependencies for optional extensions.

class Meta[source]

Bases: object

Handler meta-data.

colors = {'CRITICAL': 'red,bg_white', 'DEBUG': 'cyan', 'ERROR': 'red', 'INFO': 'green', 'WARNING': 'yellow'}

Color mapping for each log level

config_defaults = {'colorize_console_log': True, 'colorize_file_log': False, 'file': None, 'level': 'INFO', 'max_bytes': 512000, 'max_files': 4, 'rotate': False, 'to_console': True}

Default configuration settings. Will be overridden by the same settings in any application configuration file under a [log.colorlog] block.

formatter_class

alias of builtins.ColoredFormatter

formatter_class_without_color

alias of logging.Formatter

label = 'colorlog'

The string identifier of the handler.