Skip to content

Commit c070efb

Browse files
authoredNov 20, 2021
chore: Added example to provide pino core options. (#270)
1 parent 16d47b1 commit c070efb

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
 

‎Readme.md

+16
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,22 @@ logger.info('hi')
153153

154154
See the [Options](#options) section for all possible options.
155155

156+
If you are using `pino-pretty` as a stream and you need to provide options to `pino`,
157+
pass the options as the first argument and `pino-pretty` as second argument:
158+
159+
```js
160+
const pino = require('pino')
161+
const pretty = require('pino-pretty')
162+
const stream = pretty({
163+
prettyPrint: { colorize: true }
164+
})
165+
const logger = pino({ level: 'info' }, stream)
166+
167+
// Nothing is printed
168+
logger.debug('hi')
169+
```
170+
171+
156172
### Handling non-serializable options
157173

158174
Using the new [pino v7+

0 commit comments

Comments
 (0)
Please sign in to comment.