pinojs / pino-pretty

🌲Basic prettifier for Pino log lines
MIT License
1.27k stars 151 forks source link

What is the new expected programmatic usage #246

Closed PabloSzx closed 3 years ago

PabloSzx commented 3 years ago

Screenshot from 2021-10-14 12-32-18

What is the new expected programmatic usage for pino v7? the docs are showing deprecated usage https://github.com/pinojs/pino-pretty#programmatic-integration

mcollina commented 3 years ago
const pino = require('pino')
const logger = pino({
  transport: {
    target: 'pino-pretty'
  }
})
logger.info('hello world')

PTAL: https://github.com/pinojs/pino/blob/master/docs/transports.md#pino-pretty

Would you like to send a PR?

PabloSzx commented 3 years ago

@types/pino doesn't have the "transport" field :disappointed: I had to add a @ts-expect-error, there I created the pr @mcollina

mcollina commented 3 years ago

We have embedded types in pino@7, drop those types.

PabloSzx commented 3 years ago

nice, those types still don't have the "transport" option tho :cry:

mcollina commented 3 years ago

PRs always welcomed.

kibertoad commented 3 years ago

@PabloSzx https://github.com/pinojs/pino/pull/1156 takes care of that, stay tuned.

kibertoad commented 3 years ago

Fix released in 7.0.2