Closed timlohse1104 closed 1 year ago
Please consider https://github.com/pinojs/pino-pretty/pull/445 .
try
{
include: ''
}
or
{
ignore: 'level,time'
}
Thanks @vladshcherbin that's avalid option. No need for a further parameter. This issue can be closed.
For anyone interested in a config to recreate NestJS logs see the below .pino-pretty.rc.
{ "ignore": "pid,hostname,level,time", "translateTime": false, "singleLine": false, "colorize": true, "hideObject": true, "messageFormat": "[Nest] {pid} - {if req.id} ({req.id}) - {end}{time} {level} {if context}[{context}] {end} {msg}" }
The only thing missing seems to be the log of timings and multiple colors in a log. Don't know if this is possible in current state of pino-pretty.
In my testing with
--messageFormat
option i came across the question if it would be possible to mirror standard NestJS logs like this:[Nest] 45816 - 23.07.2023, 22:09:14 LOG [NestFactory] Starting Nest application... +59ms
I tried to rebuild it with '--messageFormat' string / function but could not remove the
timestamp
andlevel
in the beginning of every log.I probably overlooked something. But if thats not the case i would like to add another option 'hideMetadata' (name to be discussed).
I would add logic into https://github.com/pinojs/pino-pretty/blob/master/index.js line 135 and following.
What do you think?
Would also contribute to this closed issue: https://github.com/pinojs/pino-pretty/issues/437