Skip to content

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.

new ConsoleLogger(options?): ConsoleLogger

Defined in: observability/src/logger/console.ts:26

Record<string, unknown>

LogLevel

ConsoleLogger

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.

Record<string, unknown>

Logger

Logger.child


debug(obj, msg?): void

Defined in: observability/src/logger/console.ts:32

Logs at debug level through console.debug.

Record<string, unknown>

string

void

Logger.debug

debug(msg): void

Defined in: observability/src/logger/console.ts:33

Logs at debug level through console.debug.

string

void

Logger.debug


error(obj, msg?): void

Defined in: observability/src/logger/console.ts:53

Logs at error level through console.error.

Record<string, unknown>

string

void

Logger.error

error(msg): void

Defined in: observability/src/logger/console.ts:54

Logs at error level through console.error.

string

void

Logger.error


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.

Promise<void>

Logger.flush


info(obj, msg?): void

Defined in: observability/src/logger/console.ts:39

Logs at info level through console.info.

Record<string, unknown>

string

void

Logger.info

info(msg): void

Defined in: observability/src/logger/console.ts:40

Logs at info level through console.info.

string

void

Logger.info


warn(obj, msg?): void

Defined in: observability/src/logger/console.ts:46

Logs at warn level through console.warn.

Record<string, unknown>

string

void

Logger.warn

warn(msg): void

Defined in: observability/src/logger/console.ts:47

Logs at warn level through console.warn.

string

void

Logger.warn