colored
COLOR_MAP: t.Dict[int, str] = {logging.DEBUG: StandardColors.BRIGHT_BLACK.escape_code_fg, logging.INFO: StandardColors.BRIGHT_BLUE.escape_code_fg, logging.WARN: StandardColors.BRIGHT_YELLOW.escape_code_fg, logging.ERROR: StandardColors.BRIGHT_RED.escape_code_fg, logging.CRITICAL: StandardColors.BRIGHT_MAGENTA.escape_code_fg}
module-attribute
¶
This can be adjusted/extended for custom coloring
ColoredConsoleHandler
¶
Bases: StreamHandler
same as StreamHandler
but with colored output based on the logging-level of each message
Source code in src/loggext/handlers/colored.py
LevelColoredConsoleHandler
¶
Bases: StreamHandler
similar to ColoredConsoleHandler
but colors only the levelname