Skip to content

Commit

Permalink
Update docs to v7 (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloSzx authored Oct 14, 2021
1 parent bfea42e commit ea6352b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
shrinkwrap.yaml
package-lock.json
yarn.lock
pnpm-lock.yaml

# Logs
logs
Expand Down
17 changes: 11 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,25 +99,30 @@ recommend installing `pino-pretty` as a development dependency.
When installed, `pino-pretty` will be used by `pino` as the default
prettifier.

Install `pino-pretty` alongside `pino` and set the
`prettyPrint` option to `true`:
Install `pino-pretty` alongside `pino` and set the transport target to `'pino-pretty'`:

```js
const pino = require('pino')
const logger = pino({
prettyPrint: true
transport: {
target: 'pino-pretty'
},
})

logger.info('hi')
```

The `prettyPrint` option can also be an object containing `pretty-print`
options:
The transport option can also have an options object containing `pino-pretty` options:

```js
const pino = require('pino')
const logger = pino({
prettyPrint: { colorize: true }
transport: {
target: 'pino-pretty',
options: {
colorize: true
}
}
})

logger.info('hi')
Expand Down

0 comments on commit ea6352b

Please sign in to comment.