getPinoSink<>(logger: Logger<CustomLevels, UseOnlyCustomLevels>,options?: PinoSinkOptions,): Sink
Creates a LogTape sink that forwards log records to a Pino logger.
This adapter allows LogTape-enabled libraries to integrate seamlessly with applications that use Pino for logging.
Example 1
Example 1
import { configure } from "@logtape/logtape"; import { getPinoSink } from "@logtape/adaptor-pino"; import pino from "pino"; const pinoLogger = pino(); await configure({ sinks: { pino: getPinoSink(pinoLogger, { category: { position: "start", decorator: "[]", separator: "." } }) }, loggers: [ { category: "my-library", sinks: ["pino"] } ] });
logger: Logger<CustomLevels, UseOnlyCustomLevels>
The Pino logger instance to forward logs to.
optional
options: PinoSinkOptions
Configuration options for the sink adapter.
A LogTape sink function that can be used in LogTape configuration.