-
Notifications
You must be signed in to change notification settings - Fork 731
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
<None as Subscribe>::event_enabled should be true #2193
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for fixing this, this looks good to me.
would it make sense to add a test that would have caught the bug?
Actual context: As described by the documentation on A test is a good idea, I'll make another follow-up PR for that so this can merge ASAP. It looks like unrelated code is failing a clippy lint. |
fixed that part on |
|
## Motivation This is wrong. ## Solution Make it unwrong. As described by the documentation on `Layer::event_enabled`, the return value sets the global filtering of an event. This code used to say that that `Option::<impl Layer>::None` existing in the layer stack should disable any layer in the stack seeing events
## Motivation This is wrong. ## Solution Make it unwrong. As described by the documentation on `Layer::event_enabled`, the return value sets the global filtering of an event. This code used to say that that `Option::<impl Layer>::None` existing in the layer stack should disable any layer in the stack seeing events
# 0.3.14 (Jul 1, 2022) This release fixes multiple filtering bugs in the `Layer` implementations for `Option<impl Layer>` and `Vec<impl Layer>`. ### Fixed - **layer**: `Layer::event_enabled` implementation for `Option<impl Layer<S>>` returning `false` when the `Option` is `None`, disabling all events globally ([#2193]) - **layer**: `Layer::max_level_hint` implementation for `Option<impl Layer<S>>` incorrectly disabling max level filtering when the option is `None` ([#2195]) - **layer**: `Layer::max_level_hint` implementation for `Vec<impl Layer<S>>` returning `LevelFilter::ERROR` rather than `LevelFilter::OFF` when the `Vec` is empty ([#2195]) Thanks to @CAD97 and @guswynn for contributing to this release! [#2193]: #2193 [#2195]: #2195
# 0.3.14 (Jul 1, 2022) This release fixes multiple filtering bugs in the `Layer` implementations for `Option<impl Layer>` and `Vec<impl Layer>`. ### Fixed - **layer**: `Layer::event_enabled` implementation for `Option<impl Layer<S>>` returning `false` when the `Option` is `None`, disabling all events globally ([#2193]) - **layer**: `Layer::max_level_hint` implementation for `Option<impl Layer<S>>` incorrectly disabling max level filtering when the option is `None` ([#2195]) - **layer**: `Layer::max_level_hint` implementation for `Vec<impl Layer<S>>` returning `LevelFilter::ERROR` rather than `LevelFilter::OFF` when the `Vec` is empty ([#2195]) Thanks to @CAD97 and @guswynn for contributing to this release! [#2193]: #2193 [#2195]: #2195
…rs#2193) ## Motivation This is wrong. ## Solution Make it unwrong. As described by the documentation on `Layer::event_enabled`, the return value sets the global filtering of an event. This code used to say that that `Option::<impl Layer>::None` existing in the layer stack should disable any layer in the stack seeing events
# 0.3.14 (Jul 1, 2022) This release fixes multiple filtering bugs in the `Layer` implementations for `Option<impl Layer>` and `Vec<impl Layer>`. ### Fixed - **layer**: `Layer::event_enabled` implementation for `Option<impl Layer<S>>` returning `false` when the `Option` is `None`, disabling all events globally ([tokio-rs#2193]) - **layer**: `Layer::max_level_hint` implementation for `Option<impl Layer<S>>` incorrectly disabling max level filtering when the option is `None` ([tokio-rs#2195]) - **layer**: `Layer::max_level_hint` implementation for `Vec<impl Layer<S>>` returning `LevelFilter::ERROR` rather than `LevelFilter::OFF` when the `Vec` is empty ([tokio-rs#2195]) Thanks to @CAD97 and @guswynn for contributing to this release! [tokio-rs#2193]: tokio-rs#2193 [tokio-rs#2195]: tokio-rs#2195
Sorry @guswynn @hawkw
Motivation
This is wrong.
Solution
Make it unwrong.