Skip to content

@btravstack/observability


@btravstack/observability / pino

pino ​

Functions ​

pinoSink() ​

ts
function pinoSink(logger): Sink;

Defined in: observability/src/pino.ts:28

A Sink over a pino logger — the subpath a deployment reaches for when the default JSON sink's JSON.stringify per line is the thing showing up in a profile. pino is an optional peer: install it, import @btravstack/observability/pino, and pass the sink; a consumer that never imports this file never needs it.

ts
import pino from "pino";
import { observability } from "@btravstack/observability";
import { pinoSink } from "@btravstack/observability/pino";

observability({ sink: pinoSink(pino()) });

The level filter stays ours: createLogger has already decided the line is worth writing by the time a sink sees it, so the child logger has a trace floor — one filter in the process, and it is the one LOG_LEVEL validated at startup. The supplied logger is left unchanged. fatal and trace map to pino's own; the ambient unit's ids ride as fields, not as a message prefix, so they stay indexable.

Parameters ​

ParameterType
loggerLogger

Returns ​

Sink

Released under the MIT License.