pinojs / pino-pretty

🌲Basic prettifier for Pino log lines
MIT License
1.22k stars 147 forks source link

Allow custom format output for objects / errors #392

Open Farnsi opened 1 year ago

Farnsi commented 1 year ago

If an optional function is set, e.g. as optionobjectPrettifiers, it should be called in lib/utils.js#L407 instead of the included prettifier.

This would allow to format the data-output with tools like jsome for a better readable dev output.

The same feature errorPrettifiers could be used for errors lib/utils.js#L421, so we could use pino-pretty and add an option to format errors like in pino-pretty-min, example image.

mcollina commented 1 year ago

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.