Closed kilianc closed 6 years ago
Please read the documentation. This is already a supported feature -- https://github.com/pinojs/pino/blob/master/docs/pretty.md
@jsumners awesome! didn't see that bit!
@jsumners one more thing: useLevelLabels
and changeLevelName
don't seem to affect the object passed to prettifier
. I think this is by design reading the documentation. I think this is counterintuitive since those options are passed in the constructor.
I just wanted to confirm that this is expected and not a bug and won't change.
I can't say they won't change. A PR could be submitted with a strong argument for implementing such. But the current implementation of those options do not have anything to do with prettfication. Indeed, the useLevelLabels
option has an explicit note in the documentation that it is incompatible with transports.
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.
Currently
pino
supportsprettyPrint
that requirespino-pretty
as peer dependency and formats the output.My understanding is that
pino
doesn't support in-process logs transformation/processing and it prefers to delegate using an out-of-process program. Basically using *nix pipes.In our case we would like to use
JSON.stringify(log, null, 2)
for logs when developing locally without piping things together. In practice we want to replacepino-pretty
with a new module.I don't see a way of doing this correctly today unless I mokey-patch the require call.
Would you accept a PR that accepts
prettyJSONPrint
as option and a new module calledpino-pretty-json
? Alternatively passing the name of the module toprettyPrint
instead of justtrue
/false
.cc/ @Arun4rangan