Skip to content

NoopLogger

Defined in: observability/src/core/logger.ts:72

The disabled-logging path made explicit — one shared no-op instead of a scatter of if (!enabled) return guards at every call site. Symmetric with NoopErrorSink / NoopAnalyticsSink in ./sinks.js. child() returns this — a whole tree of child loggers collapses to one instance.

Use it for the opted-out path, for non-vitest tests/examples that need a Logger but no output, or anywhere else a real transport is not worth the dependency. Vitest-based test doubles (fakeLogger, which records calls instead of discarding them) live in @theholocron/observability/testing.

new NoopLogger(): NoopLogger

NoopLogger

child(_bindings?): Logger

Defined in: observability/src/core/logger.ts:81

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(_objOrMsg?, _msg?): void

Defined in: observability/src/core/logger.ts:74

Discards the line.

string | Record<string, unknown>

string

void

Logger.debug


error(_objOrMsg?, _msg?): void

Defined in: observability/src/core/logger.ts:80

Discards the line.

string | Record<string, unknown>

string

void

Logger.error


flush(): Promise<void>

Defined in: observability/src/core/logger.ts:84

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(_objOrMsg?, _msg?): void

Defined in: observability/src/core/logger.ts:76

Discards the line.

string | Record<string, unknown>

string

void

Logger.info


warn(_objOrMsg?, _msg?): void

Defined in: observability/src/core/logger.ts:78

Discards the line.

string | Record<string, unknown>

string

void

Logger.warn