Skip to content

Commit

Permalink
Improve docs and deprecation about prettyPrint (pinojs#1203)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina authored Nov 1, 2021
1 parent 43906c7 commit 1726618
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ and searching for logged objects can start from a consistent path.

Default: `false`

__DEPRECATED: use [`transport`](#transport) instead.__
__DEPRECATED: look at [pino-pretty documentation](https://github.com/pinojs/pino-pretty)
for alternatives__. Using a [`transport`](#transport) is also an option.__

Enables pretty printing log logs. This is intended for non-production
configurations. This may be set to a configuration object as outlined in the
Expand Down
7 changes: 7 additions & 0 deletions examples/basic.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
'use strict'

// Pino's primary usage writes ndjson to `stdout`:
const pino = require('..')()

// However, if "human readable" output is desired,
// `pino-pretty` can be provided as the destination
// stream by uncommenting the following line in place
// of the previous declaration:
// const pino = require('..')(require('pino-pretty')())

pino.info('hello world')
pino.error('this is at error level')
pino.info('the answer is %d', 42)
Expand Down
2 changes: 1 addition & 1 deletion lib/deprecations.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ module.exports = warning

const warnName = 'PinoWarning'

warning.create(warnName, 'PINODEP008', 'prettyPrint is deprecated, use the pino-pretty transport instead')
warning.create(warnName, 'PINODEP008', 'prettyPrint is deprecated, look at https://github.com/pinojs/pino-pretty for alternatives.')

0 comments on commit 1726618

Please sign in to comment.