The various options for the ANSI color formatter.
timestamp:
The timestamp format. This can be one of the following:
"date-time-timezone"
: The date and time with the full timezone offset (e.g.,"2023-11-14 22:13:20.000 +00:00"
)."date-time-tz"
: The date and time with the short timezone offset (e.g.,"2023-11-14 22:13:20.000 +00"
)."date-time"
: The date and time without the timezone offset (e.g.,"2023-11-14 22:13:20.000"
)."time-timezone"
: The time with the full timezone offset but without the date (e.g.,"22:13:20.000 +00:00"
)."time-tz"
: The time with the short timezone offset but without the date (e.g.,"22:13:20.000 +00"
)."time"
: The time without the date or timezone offset (e.g.,"22:13:20.000"
)."date"
: The date without the time or timezone offset (e.g.,"2023-11-14"
)."rfc3339"
: The date and time in RFC 3339 format (e.g.,"2023-11-14T22:13:20.000Z"
).
Alternatively, this can be a function that accepts a timestamp and returns a string.
The default is "date-time-tz"
.
timestampStyle: AnsiStyle | null
The ANSI style for the timestamp. "dim"
is used by default.
timestampColor: AnsiColor | null
The ANSI color for the timestamp. No color is used by default.
levelStyle: AnsiStyle | null
The ANSI style for the log level. "bold"
is used by default.
levelColors: Record<LogLevel, AnsiColor | null>
The ANSI colors for the log levels. The default colors are as follows:
"debug"
:"blue"
"info"
:"green"
"warning"
:"yellow"
"error"
:"red"
"fatal"
:"magenta"
categoryStyle: AnsiStyle | null
The ANSI style for the category. "dim"
is used by default.
categoryColor: AnsiColor | null
The ANSI color for the category. No color is used by default.