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

fix Layered's max_level_hint impl #2317

Closed
wants to merge 1 commit into from

Conversation

guswynn
Copy link
Contributor

@guswynn guswynn commented Sep 21, 2022

Motivation

Fixes: #2265

Solution

When there are no per-layer filters, the Layered pick_level_hint function is wrong. It prioritizes Some(_) over None, even though None is basically Some(TRACE). This was not notices because most people are doing one of:

  1. global filtering which works differently (as far as I can tell)
  2. per-layer filtering, whose code-path seems to work (it also short-circuits None)
    1. the fmt subscriber, which happened to work with this change

In this branch we also have to fix the fmt Collector, which implements Collect and erroneously passes through to a layer that unconditionally returns None. This is the correct option for the layer itself, but overrides the behavior we want for the subscriber, which is to follow the F field directly. We set inner_is_registry directly to combat this problem

@guswynn guswynn requested review from hawkw, davidbarsky and a team as code owners September 21, 2022 20:33
@guswynn
Copy link
Contributor Author

guswynn commented Sep 23, 2022

closing in favor of #2321

@guswynn guswynn closed this Sep 23, 2022
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-layers resets loglevel
1 participant