class documentation
class ColorHandler(logging.StreamHandler): (source)
A color log handler.
You can use this handler by incorporating the example below into your logging configuration:
conf/project/logging.yml:
formatters: simple: format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s" handlers: console: class: kedro.extras.logging.ColorHandler level: INFO formatter: simple stream: ext://sys.stdout # defining colors is optional colors: debug: white info: magenta warning: yellow root: level: INFO handlers: [console]
The colors parameter is optional, and you can use any ANSI color.
- Black
- Red
- Green
- Yellow
- Blue
- Magenta
- Cyan
- White
The default colors are:
- debug: magenta
- info: cyan
- warning: yellow
- error: red
- critical: red
Method | __init__ |
Undocumented |
Method | format |
The handler formatter. |
Instance Variable | colors |
Undocumented |
Method | _get |
Undocumented |
The handler formatter.
Parameters | |
record:logging.LogRecord | The record to format. |
Returns | |
str | The record formatted as a string. |