Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support use as a Pino transport #48

Open
segevfiner opened this issue May 10, 2022 · 2 comments
Open

Support use as a Pino transport #48

segevfiner opened this issue May 10, 2022 · 2 comments

Comments

@segevfiner
Copy link

pretty-print & prettifier the new recommended way of integrating a prettifier via API is using a pino.transport. pino-pretty supports this so can probably checked to see an example of how.

@segevfiner
Copy link
Author

Consider using https://github.com/pinojs/pino-abstract-transport for this.

@petercpwong
Copy link

For anyone who's having trouble using this with the latest version of pino, here's a quick hack to get things working:

const pino = require('pino');
const pinoPretty = require('pino-pretty');
const pinoColada = require('pino-colada');

const logger = pino(
  {
    // pino options
  },
  pinoPretty({
    hideObject: true,
    levelKey: '',
    messageFormat: pinoColada(),
    singleLine: true,
    timestampKey: ''
  })
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants