pino icon indicating copy to clipboard operation
pino copied to clipboard

Improve prettifier documentation

Open felixheck opened this issue 7 years ago β€’ 7 comments

Hi there!

AFAIK, since the v5 release and the integration of pretty-pino the prettyPrint.formatter option is useless.

Is there an easy way to migrate the prettyPrint.formatter option to v5 though? πŸ˜”

Cheers!

felixheck avatar Aug 31 '18 13:08 felixheck

what do you mean?

mcollina avatar Aug 31 '18 14:08 mcollina

There was a prettyPrint.formatter option in pino <=4 β€” this option is not available because pino-pretty doesn’t support such option.

And since I try to stay up to date, I’m looking for an alternative way to format the output.

felixheck avatar Aug 31 '18 14:08 felixheck

Oh, we have internalized that functionality and forgot to write the docs: https://github.com/pinojs/pino/issues/478.

mcollina avatar Aug 31 '18 14:08 mcollina

Actually there is non-documented (mistake) API https://github.com/pinojs/pino/blob/master/lib/tools.js#L159-L170. passing a prettifier function would do the same function of prettyPrint.formatter.

Would you like to help and figure out the docs?

mcollina avatar Aug 31 '18 14:08 mcollina

Ah awesome πŸ™ŒπŸΌ Gonna try to fire a PR tomorrow in the plane β€” otherwise after my holiday 😊

Thanks Matteo!

felixheck avatar Aug 31 '18 14:08 felixheck

Yes it is documented -- http://getpino.io/#/docs/pretty?id=prettifier-api

jsumners avatar Aug 31 '18 15:08 jsumners

I think we can do a bit better, the example is not really self-explanatory.

The reference implementation of such a module is the pino-pretty module. To learn more about creating a custom prettifier module, refer to the pino-pretty source code.

We can actually explain this.

mcollina avatar Aug 31 '18 16:08 mcollina

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Feb 18 '23 00:02 github-actions[bot]