ConsoleLogger
Defined in: observability/src/logger/console.ts:22
A zero-dependency Logger over the platform console — no Pino, no
worker thread, no transports. Use it in the browser, an edge runtime, or
React Native, or anywhere the Pino weight is not worth it. Structured calls
are emitted as (message, contextObject); child() bindings are merged into
every line’s context.
There is no Axiom shipping here — that is a Node-transport concern. A
ConsoleLogger is for local visibility only.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ConsoleLogger(
options?):ConsoleLogger
Defined in: observability/src/logger/console.ts:26
Parameters
Section titled “Parameters”options?
Section titled “options?”bindings?
Section titled “bindings?”Record<string, unknown>
level?
Section titled “level?”Returns
Section titled “Returns”ConsoleLogger
Methods
Section titled “Methods”child()
Section titled “child()”child(
bindings):Logger
Defined in: observability/src/logger/console.ts:59
Derive a child logger that inherits every binding from its parent and
adds its own. Used to attach per-module context (module, repo, …)
without threading extra fields through every call.
Parameters
Section titled “Parameters”bindings
Section titled “bindings”Record<string, unknown>
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”debug()
Section titled “debug()”Call Signature
Section titled “Call Signature”debug(
obj,msg?):void
Defined in: observability/src/logger/console.ts:32
Logs at debug level through console.debug.
Parameters
Section titled “Parameters”Record<string, unknown>
string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Call Signature
Section titled “Call Signature”debug(
msg):void
Defined in: observability/src/logger/console.ts:33
Logs at debug level through console.debug.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”error()
Section titled “error()”Call Signature
Section titled “Call Signature”error(
obj,msg?):void
Defined in: observability/src/logger/console.ts:53
Logs at error level through console.error.
Parameters
Section titled “Parameters”Record<string, unknown>
string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Call Signature
Section titled “Call Signature”error(
msg):void
Defined in: observability/src/logger/console.ts:54
Logs at error level through console.error.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”flush()
Section titled “flush()”flush():
Promise<void>
Defined in: observability/src/logger/console.ts:66
Resolve once every line logged so far has actually left the process.
Matters specifically for a worker-thread transport (Axiom): the call
that enqueues a line returns before that line reaches the network — the
worker thread needs its own event-loop turn to flush the batch over
HTTP. A short-lived process (a serverless function returning its
response) can exit before that turn happens, silently dropping every
buffered line. Call this before returning from such a handler; a
synchronous sink (ConsoleLogger, NoopLogger, plain stdout NDJSON
with no transport) has nothing to wait for and resolves immediately.
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”info()
Section titled “info()”Call Signature
Section titled “Call Signature”info(
obj,msg?):void
Defined in: observability/src/logger/console.ts:39
Logs at info level through console.info.
Parameters
Section titled “Parameters”Record<string, unknown>
string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Call Signature
Section titled “Call Signature”info(
msg):void
Defined in: observability/src/logger/console.ts:40
Logs at info level through console.info.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”warn()
Section titled “warn()”Call Signature
Section titled “Call Signature”warn(
obj,msg?):void
Defined in: observability/src/logger/console.ts:46
Logs at warn level through console.warn.
Parameters
Section titled “Parameters”Record<string, unknown>
string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Call Signature
Section titled “Call Signature”warn(
msg):void
Defined in: observability/src/logger/console.ts:47
Logs at warn level through console.warn.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void