James Sumners
James Sumners
> Another option is to spin it as a separate package and remove it from pino altogether. I support this proposal.
`logger.error(err)` gets serialized by the error serializer attached to the Pino instance. If you want a different serialization, you need to provide a serializer that does what you want.
The implementation here recognizes serialized errors from Pino.
I think it would be better to make it a factory function option that gets cached as we do with other things of this nature. It would remove the function...
https://github.com/fastify/fastify/blob/660eea97b094de11d2619d711c1313fb3caba567/lib/route.js
> `It would remove the function invocation cost at every request and make it a symbol lookup.` > > How would that work if we may need to dynamically recalculate...
> * Extract `lib/server.js` in separate module Do you mean a literal `npmjs.com` module, e.g. `@fastify/server`? If so, I disagree. That would make maintenance more difficult, and increase the complexity...
Is this resolved by #4899?
I'll try to review tomorrow.
If I'm reading things correctly, the reproduction _should_ hit line 189 in: https://github.com/fastify/fastify/blob/ac26d7b4cadca3a2673fca5853863be498839c60/lib/reply.js#L162-L215 If it's not, I'd classify that as a bug.