Colorlog
Introduction
The ColorLog Extension provides the ColorLogHandler
for logging, and is a sub-class and drop-in replacement for the default log handler LoggingLogHandler
.
Documentation References:
API References:
Requirements
Colorlog
Cement 3.0.8+:
pip install cement[colorlog]
Applications using Cement <3.0.8 should continue to include colorlog
in their dependencies.
Installation
Configuration
This handler honors the following settings under a [log.colorlog]
section of the configuration:
Note that there are precautions in place to disable colorized logging if the session is not a valid TTY via sys.stdout.istty()
A sample config section might look like:
Usage
The colors can be customized by passing in a colors
dictionary mapping overriding the ColorLogHandler.Meta.colors
option
Last updated