Files
boc/services/frilans-payout/node_modules/pino/docs/pretty.md
T
Bernt 1a12fb870b dev-api: add developer portal, OpenAPI spec, and Flatenbadet case study
- New /developers/ page with API docs, SDKs, pricing, use cases
- OpenAPI 3.0 spec for Orders, Missions, Photos, Analytics
- Case study: Glasskiosken i Flatenbadet — complete ROI analysis
- Updated /order/ with recurring missions and frequency dropdown
2026-07-14 15:27:33 +00:00

939 B

Pretty Printing

By default, Pino log lines are newline delimited JSON (NDJSON). This is perfect for production usage and long-term storage. It's not so great for development environments. Thus, Pino logs can be prettified by using a Pino prettifier module like pino-pretty:

  1. Install a prettifier module as a separate dependency, e.g. npm install pino-pretty.
  2. Instantiate the logger with the transport.target option set to 'pino-pretty':
const pino = require('pino')
const logger = pino({
  transport: {
    target: 'pino-pretty'
  },
})

logger.info('hi')
  1. The transport option can also have an options object containing pino-pretty options:
const pino = require('pino')
const logger = pino({
  transport: {
    target: 'pino-pretty',
    options: {
      colorize: true
    }
  }
})

logger.info('hi')