@nwire/logger-pino
v0.7.1
Published
Nwire — Pino-backed Logger adapter. Production-grade structured logging; envelope ids auto-attached via child().
Readme
@nwire/logger-pino
Pino-backed
Loggeradapter — structured logging.
What it does
Adapts pino to the @nwire/logger contract. Bindings flow through child(bindings) so envelope ids (correlationId, causationId, tenant, userId) attach with zero allocation overhead per log call. JSON-line output for production; pino-pretty for dev.
Install
pnpm add @nwire/logger-pino pino
# dev only:
pnpm add -D pino-prettyQuick start
import { createPinoLogger } from "@nwire/logger-pino";
import { createApp } from "@nwire/forge";
const logger = createPinoLogger({
level: "info",
service: "learnflow-api",
transport: process.env.NODE_ENV === "development" ? { target: "pino-pretty" } : undefined,
});
const app = createApp("learnflow", { modules, logger });API surface
createPinoLogger({ level?, service?, transport?,... })— produces aLogger. Allpinooptions pass through.
When to use
Every production wire.
Within nwire-app
For developers using this package as part of the Nwire stack — register it via app.use(...) or it auto-wires when you compose createApp({ modules }).
import { createApp } from "@nwire/forge";
const app = createApp({
/* ...config... */
});
// Adapter/plugin wiring happens here when applicable.