Skip to content

error in one Hook.Fire() prevents subsequent hooks from firing #408

Description

@tochiai

The loop in LevelHooks.Fire() is interrupted when there is an error, which is undesirable in our use case. This is different behavior from the doc comment:

// Fire all the hooks for the passed level.

Our workaround is to LevelHooks.Add() the hooks in order of increasing likelihood of an error so that the loop will not terminate prematurely.

We think it is preferable to allow all of the hooks in LevelHooks to attempt to fire. This can be accomplished by using go-multierror to capture errors as they arise, and then return the collective error after the loop has fired all the hooks for a log level. I'm happy to submit a PR if this seems like a desirable change.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions