levelColors property
A mapping between LogLevels and their associated ANSI foreground color.
These colors are used to style log messages with consistent, meaningful color coding based on severity level:
| Level | Color Code | Description |
|---|---|---|
| trace | 8 | Dim gray |
| debug | 12 | Bright blue |
| info | 10 | Bright green |
| warning | 11 | Bright yellow |
| error | 9 | Bright red |
| fatal | 196 | Vivid red (alert) |
Use these to format terminal output for better visual scanning.
Implementation
static final levelColors = {
LogLevel.TRACE: AnsiColor.BLUE,
LogLevel.DEBUG: AnsiColor.BLUE,
LogLevel.INFO: AnsiColor.GREEN,
LogLevel.WARN: AnsiColor.YELLOW,
LogLevel.ERROR: AnsiColor.RED,
LogLevel.FATAL: AnsiColor.RED,
};