-
Notifications
You must be signed in to change notification settings - Fork 10
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
Log an error object along with context-specific error message #15
Comments
Sounds great to me! |
How do you feel about this? try {
JSON.parse('#')
} catch (err) {
log.error('failed to parse json', err)
}
If this makes sense to you, I'll open a PR. Another example that shows how extra properties of log.error('failed to update podcast', err)
|
@raine sounds good to me! As close as possible to the existing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Thanks for a great library.
I want to log an error object along with a message that describes the context of the error.
However, that results in
I'm aware you can do
log.error(err)
, which results in a nice log message of the error, but most of time I actually want to include a custom message, without logging two lines.What if
log.error('Error while doing x', err)
printed the following?The text was updated successfully, but these errors were encountered: