pino-pretty
Pretty-printer for Pino JSON logs to make terminal output human-readable.
3. Used by agents' projects
Dependency in 66 public GitHub projects set up for AI coding agents that we scanned (1.1%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What pino-pretty does
pino-pretty turns Pino's one-line JSON logs into readable terminal lines, and its own README says to keep it out of production and install it only as a dev dependency.
pino-pretty popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How pino-pretty is used
- pino-pretty is a dependency in 66 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (1.4% of the 4,867 JavaScript/TypeScript ones), #10 of 121 in logging, monitoring and analytics.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 398; those are left out of every share on this page.
- The most used alternative in our scan is Winston (55 projects).
- Projects that use it most often also use Pino (87.9%), Vitest (71.2%), tsx (56.1%).
By coding agent
Often used with
pino-pretty in practice
Strengths
The README recommends piping app output into the CLI. This needs no code changes. The same formatter also works as a Pino <code>transport</code> target or as a stream passed to <code>pino()</code>.
<code>--minimumLevel</code> hides lower-level lines. <code>--ignore</code> and <code>--include</code> pick which keys to show, and both support dotted nested keys. For more filtering than that, the README points to <code>jq</code>.
<code>messageFormat</code> takes a template such as <code>{levelLabel} - {pid} - url:{req.url}</code>. The template can include <code>{if pid}...{end}</code> blocks. It can also be a function.
<code>customPrettifiers</code> maps a log property to a function. It can reformat <code>time</code>, <code>level</code>, <code>hostname</code>, <code>pid</code>, <code>name</code>, <code>caller</code> or any custom key. Each function also receives a Colorette <code>colors</code> object.
Watch out for
The maintainers advise against running it in production and recommend installing it with <code>--save-dev</code>. The README shows a way to enable the transport only when <code>process.stdout.isTTY</code> is true.
Asynchronous writes conflict with how Jest ends tests. The README calls <code>pino(pretty({ sync: true }))</code> "the only supported way" to use it with Jest.
Pino v7+ transports cannot pass non-serializable options. A function <code>messageFormat</code> or prettifier therefore means writing a small wrapper module and pointing <code>target</code> at it.
Pretty logs only when attached to a terminal
const pino = require('pino')
// Define the transport configuration only when the output stream is connected to a TTY
const transport = process.stdout.isTTY ? { transport: { target: 'pino-pretty' } } : {};
const logger = pino({ ...transport })
logger.info('hi')More about pino-pretty
Packages around it
- pino: The logger it formats
- next: React framework
- typescript: Typed JavaScript
- axios: HTTP client
- @tanstack/react-query: Server-state fetching for React
- wagmi: React hooks for Ethereum
More in Logging, monitoring and analytics
Alternatives
pino-pretty This page
Versatile Node.js logging library supporting multiple transports and levels.
Get started
Install it.
npm install pino-prettyRules for your agent
## pino-pretty
- Install it as a dev dependency (`npm install --save-dev pino-pretty`). Do not make production logging depend on it.
- Prefer piping output (`node app.js | pino-pretty`) or a `transport: { target: 'pino-pretty' }` gated on `process.stdout.isTTY`.
- When using it as a stream with Pino options, pass the options first and the stream second: `pino({ level: 'info' }, stream)`.
- In Jest tests, use `pino(pretty({ sync: true }))`. That is the only supported setup.
- Function-valued options such as `messageFormat` or `customPrettifiers` cannot go through transport options. Wrap pino-pretty in a custom module and target that file.
- Do not pass both `ignore` and `include`, because `ignore` is then dropped. Do not use `errorProps` with pino@7.
- For filtering beyond `minimumLevel`, `ignore` and `include`, use `jq` instead of extending pino-pretty.