ColoredFormatter

Description

class lab_utils.custom_logging.ColoredFormatter(fmt=None, datefmt=None, style='%')[source]

Console formatter that prepends the coloured severity level of the message. Based upon this gist.

Attributes

ColoredFormatter.colour_map

Colour mapping.

ColoredFormatter.colours

Terminal colour codes.

ColoredFormatter.prefix

Prefix to modify terminal output colour.

ColoredFormatter.suffix

Suffix to modify terminal output colour.

Methods

ColoredFormatter.format

Prepends a fixed-length, coloured trailer with the log level.