Closed mfogel closed 3 years ago
@mfogel Right now, this package will handle Error
objects correctly when passed in as the message versus within the meta
. I can see the use cases where you may want to pass an error in the meta
instead.
I'm trying to keep the number of dependencies within this package as minimal as possible so I think I would like to recreate the functionality of the error-to-json
package inside of this one given it's a minimal amount of code.
I'll work on adding this in the next release. Thanks for the feature request!
@mfogel This has been implemented and published in v3.0.0. I'm still waiting on the site to go live with the updated documentation. Thanks for the feature suggestion!
Thanks @KyleRoss ! Appreciate it very much!
@all-contributors please add @mfogel for ideas
@KyleRoss
I've put up a pull request to add @mfogel! :tada:
Hi, thanks a bunch for this project. Super helpful.
Right now, when passing
Error
objects in themeta
parameter they get logged as{}
because of the design of theError
object (as you know doubt know).I can use
log.options.replacer
to get a much better serialization of the Error object (using the error-to-json package here):My suggestion is to consider making this the default behavior. Are there any use cases where serializing an
Error
to{}
would be the better behavior?Thanks again for the project!