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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NoopLogger():
NoopLogger
Returns
Section titled “Returns”NoopLogger
Methods
Section titled “Methods”child()
Section titled “child()”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.
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()”debug(
_objOrMsg?,_msg?):void
Defined in: observability/src/core/logger.ts:74
Discards the line.
Parameters
Section titled “Parameters”_objOrMsg?
Section titled “_objOrMsg?”string | Record<string, unknown>
string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”error()
Section titled “error()”error(
_objOrMsg?,_msg?):void
Defined in: observability/src/core/logger.ts:80
Discards the line.
Parameters
Section titled “Parameters”_objOrMsg?
Section titled “_objOrMsg?”string | Record<string, unknown>
string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”flush()
Section titled “flush()”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.
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”info()
Section titled “info()”info(
_objOrMsg?,_msg?):void
Defined in: observability/src/core/logger.ts:76
Discards the line.
Parameters
Section titled “Parameters”_objOrMsg?
Section titled “_objOrMsg?”string | Record<string, unknown>
string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”warn()
Section titled “warn()”warn(
_objOrMsg?,_msg?):void
Defined in: observability/src/core/logger.ts:78
Discards the line.
Parameters
Section titled “Parameters”_objOrMsg?
Section titled “_objOrMsg?”string | Record<string, unknown>
string
Returns
Section titled “Returns”void