Skip to content

Commit

Permalink
subscriber: <None as Subscribe>::event_enabled should be true (#2193
Browse files Browse the repository at this point in the history
)

## Motivation

This is wrong.

## Solution

Make it unwrong.

As described by the documentation on `Subscribe::event_enabled`, the
return value sets the global filtering of an event. This code used to
say that that `Option::<impl Subscribe>::None` existing in the
subscriber stack should disable any subscriber in the stack seeing
events
  • Loading branch information
CAD97 authored Jun 30, 2022
1 parent 8030eb9 commit 665ad11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tracing-subscriber/src/subscribe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ where
fn event_enabled(&self, event: &Event<'_>, ctx: Context<'_, C>) -> bool {
match self {
Some(ref inner) => inner.event_enabled(event, ctx),
None => false,
None => true,
}
}

Expand Down

0 comments on commit 665ad11

Please sign in to comment.