oslo_log.handlers.
ColorHandler
(stream=None)¶Bases: logging.StreamHandler
Log handler that sets the ‘color’ key based on the level
To use, include a ‘%(color)s’ entry in the logging_context_format_string. There is also a ‘%(reset_color)s’ key that can be used to manually reset the color within a log line.
LEVEL_COLORS
= {5: '\x1b[00;35m', 10: '\x1b[00;32m', 20: '\x1b[00;36m', 21: '\x1b[01;36m', 30: '\x1b[01;33m', 40: '\x1b[01;31m', 50: '\x1b[01;31m'}¶format
(record)¶Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.