-
Notifications
You must be signed in to change notification settings - Fork 847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mention passing errors in the docs #949
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a nit
Co-authored-by: Matteo Collina <matteo.collina@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
docs/api.md
Outdated
<a id="errors"></a> | ||
#### Errors | ||
|
||
Errors can be supplied as either the first parameter or if already using `mergingObject` then as the `err` on the `mergingObject`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is accurate if the user has not customized the serializers, e.g.:
const logger = pino({
serializers: {
error: stdSerializers.error
}
})
In the above, the err
serializer, as described in this documentation, will not be defined. Instead, it is renamed to error
. So:
// Will not serialize
logger.error({ err: Error('boom') })
// Will serialize
logger.error({ error: Error('boom') })
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to point this out, let me know if you have a more concise sentence.
Co-authored-by: James Sumners <james@sumners.email>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
fixes #948