pinojs / pino-pretty

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

Pino Pretty does not output numbers but only strings. #433

Closed mrigankvallabh closed 1 year ago

mrigankvallabh commented 1 year ago

I have a very simple log file with as below app.log

{"level":30,"time":"2023-06-19T04:01:56.478Z","pid":2484,"hostname":"YMLTITD2227","msg":77}
{"level":30,"time":"2023-06-19T04:01:56.478Z","pid":2484,"hostname":"YMLTITD2227","msg":"42"}

Notice that first message is number 77, while the other is string 42. If I do cat app.log | npx pino-pretty, I get the below output

[12:01:56.478] INFO (2484):
[12:01:56.478] INFO (2484): 42

It does NOT display the numbers, but only the strings. I was hoping that pino-pretty should be able to interpret numbers as strings.

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.