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 support for logger-local error handlers #528

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elindsey
Copy link

There are some use cases for writing to zerolog from within the ErrorHandler, but today this is extremely tricky to do safely as it can easily lead to ErrorHandlers triggering ErrorHandlers (causing a log bomb). Logger-local error handlers allow us to configure eg. a primary logger with an ErrorHandler that calls a secondary logger with no ErrorHandler.

Event struct was rearranged to save space; gofmt adjusted some doc indenting in log.go.

There are some use cases for writing to zerolog from within the
ErrorHandler, but today this is extremely tricky to do safely as it can
easily lead to ErrorHandlers triggering ErrorHandlers (causing a log
bomb). Logger-local error handlers allow us to configure eg. a primary
logger with an ErrorHandler that calls a secondary logger with no
ErrorHandler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant