Skip to content
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

Add WithContext #919

Merged
merged 1 commit into from Mar 11, 2019
Merged

Add WithContext #919

merged 1 commit into from Mar 11, 2019

Conversation

@tgwizard
Copy link
Collaborator

@tgwizard tgwizard commented Mar 11, 2019

Add WithContext(ctx context.Context) method, and a Context property, on Entry. Contexts aren't that useful for the logging itself, but it can be very useful for hooks you may have configured.

Example: You have Bugsnag configured, which store request metadata in the context, and you want to notify Bugsnag on any error-level logs. Without passing along the context through the log entry, the Bugsnag report will lack a lot of interesting detail.

@dgsb
Copy link
Collaborator

@dgsb dgsb commented Mar 11, 2019

Context are pretty useful indeed.
Thanks for your contribution @tgwizard

@dgsb dgsb merged commit 5bd5a31 into sirupsen:master Mar 11, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@tgwizard
Copy link
Collaborator Author

@tgwizard tgwizard commented Mar 11, 2019

Thanks @dgsb @lavoiesl!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants