pino-pretty does not output numbers, but only strings

135 Views Asked by At

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.

1

There are 1 best solutions below

0
On

It turns out that this is actually a bug. I have raised this issue https://github.com/pinojs/pino-pretty/issues/433