James Sumners
James Sumners
Can you provide a full reproduction? I am not seeing this issue. **index.js** ```js const log = require('pino')() const err = Error('boom') log.info({ err, foo: 'foo' }, 'Error!!! %s', err.message)...
The hook has no way of obtaining that context: https://github.com/pinojs/pino/blob/95856d1198a4067f9916a2b7e636b71f58bebeb2/lib/tools.js#L30-L35
> Is not `this`? Maybe? I think bindings are rendered to a string at child creation.
https://github.com/pinojs/pino/blob/248be4eaf990cec1f06b648df1d3f41f2e503329/pino.js#L122 Pino is writing directly to the `stdout` file descriptor in its default configuration. I suppose AWS Lambda doesn't trap these writes like it does for `console.log` writes. You could...
@tonyxiao that's entirely up to you. I'm not suggesting implementation details. I'm merely providing an idea.
I'm not opposed.
This is likely due to the fact that we do not de-duplicate properties -- https://github.com/pinojs/pino/blob/3a78dbc8fa29dac1ad242b9d564abb9399c055bd/docs/child-loggers.md#duplicate-keys-caveat
I'm not clear if that is the issue, but I suspect it is. Someone will have to do some investigation.
Did you write it to a file to determine that it is written correctly? `node foo.js | tee output.json`
I think this adds complexity for very little gain. I'm 👎