Documentation / @zerotal/core / logger / ConsoleChannel
Class: ConsoleChannel
Defined in: logger/channels/ConsoleChannel.ts:42
Writes log entries to process.stdout.
In "pretty" format (the default) it emits a colorized, human-readable line
— dimmed time, level-colored level, message, an 8-char request-id snippet,
inline context JSON, and any error/stack. In "json" format it writes the
full LogEntry as one JSON line, suitable for log collectors.
Example
// config/logging.ts
channels: {
console: { driver: "console", format: "json" }, // or "pretty"
}
Implements
Constructors
Constructor
new ConsoleChannel(
_format?):ConsoleChannel
Defined in: logger/channels/ConsoleChannel.ts:44
Parameters
_format?
"json" | "pretty"
"pretty" for colorized output (default) or "json" for one JSON line per entry.
Returns
ConsoleChannel
Methods
write()
write(
entry):Promise<void>
Defined in: logger/channels/ConsoleChannel.ts:46
Parameters
entry
Returns
Promise<void>