pinojs / pino-pretty

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

to suport req.id #124

Open hao5743 opened 4 years ago

hao5743 commented 4 years ago

For log example: {req: {id: '123'}, context: 'hello'} If prettifyMessage set to {req.id}, shoud get the value '123'

hao5743 commented 4 years ago

In some cases, if log had one key 'req.id', For example: {req: {id: '123'}, 'req.id':'me', context: 'hello'} this would return 'me'

jsumners commented 4 years ago

I'm not seeing this issue:

❯ echo '{"req":{"id":3}}' | npx pino-pretty
npx: installed 35 in 1.707s
    req: {
      "id": 3
    }

❯ echo '{"req":{"id":3}, "req.id":"foo"}' | npx pino-pretty
npx: installed 35 in 1.689s
    req: {
      "id": 3
    }
    req.id: "foo"