pino-pretty colorised formatting for local dev.
The LoggerType interface
Every logger provider satisfies the same contract, so all log calls work identically regardless of which provider is active:
getFeatureLogger creates a child logger scoped to a named feature. Pino implements this as a true child logger with { feature } bound and a duration field (ms since the child was created) appended to every line:
getFeatureLogger for any operation that spans multiple log lines — it makes log correlation trivial in aggregators.
Why
Pino is one of the fastest Node.js loggers available — it serialises log lines to JSON with minimal overhead and integrates cleanly with log aggregators like Datadog, Logtail, or CloudWatch. Thepretty: true flag activates pino-pretty for colorised, human-readable output during local development, while production stays machine-parseable JSON.
Setup
- In
apps/backend/package.json, ensure"tooling-logger-pino": "workspace:*"is listed underdependencies. - Run
make pnpm-lockfile-updatethenmake pnpm-install. - In
development.ts, settools.logger: - In
production.ts, settools.logger: - Run
make test module=tooling-logger-pinoandmake test module=backend.
Log levels
| Method | When to use |
|---|---|
logger.info(message, meta) | Successful operations, important lifecycle events |
logger.warn(message, meta) | Expected failures, business-rule violations, degraded states |
logger.error(error, meta) | Unexpected exceptions, system failures |
Gotchas
pretty: truerequirespino-prettyto be installed. It is a dependency oftooling-logger-pino, so it’s available automatically.- Pino serialises log arguments asynchronously in a worker thread. Very high-frequency logging (> 100k lines/sec) can cause slight buffering — this is normal.
- Never set
pretty: trueintest.ts— it adds noise to test output. Leave itfalseor omit it entirely.
What’s next?
- Console — the minimal fallback provider.
- Configuration — switching pluggable tool implementations.
- Tooling system — how loaders and workspace packages fit together.