pino
pino copied to clipboard
Improve prettifier documentation
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!
what do you mean?
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.
Oh, we have internalized that functionality and forgot to write the docs: https://github.com/pinojs/pino/issues/478.
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?
Ah awesome ππΌ Gonna try to fire a PR tomorrow in the plane β otherwise after my holiday π
Thanks Matteo!
Yes it is documented -- http://getpino.io/#/docs/pretty?id=prettifier-api
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.
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.