pino-pretty icon indicating copy to clipboard operation
pino-pretty copied to clipboard

to suport req.id

Open hao5743 opened this issue 3 years ago • 2 comments

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

hao5743 avatar Aug 17 '20 17:08 hao5743

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

hao5743 avatar Aug 17 '20 17:08 hao5743

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"

jsumners avatar Aug 17 '20 22:08 jsumners