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

fmt: fix EnvFilter rejecting levels equal to the filter level #75

Merged
merged 1 commit into from
Jun 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tokio-trace-fmt/src/filter/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ where

impl<N> Filter<N> for EnvFilter {
fn callsite_enabled(&self, metadata: &Metadata, _: &Context<N>) -> Interest {
if !self.includes_span_directive && self.max_level <= *metadata.level() {
if !self.includes_span_directive && self.max_level < *metadata.level() {
return Interest::never();
}

let mut interest = Interest::never();
for directive in self.directives_for(metadata) {
let accepts_level = directive.level > *metadata.level();
let accepts_level = directive.level >= *metadata.level();
match directive.in_span.as_ref() {
// The directive applies to anything within the span described
// by this metadata. The span must always be enabled.
Expand All @@ -129,7 +129,7 @@ impl<N> Filter<N> for EnvFilter {

fn enabled<'a>(&self, metadata: &Metadata, ctx: &Context<'a, N>) -> bool {
for directive in self.directives_for(metadata) {
let accepts_level = directive.level > *metadata.level();
let accepts_level = directive.level >= *metadata.level();
match directive.in_span.as_ref() {
// The directive applies to anything within the span described
// by this metadata. The span must always be enabled.
Expand Down