Skip to content

Commit

Permalink
add extra fields to Debug impl from #1528
Browse files Browse the repository at this point in the history
Signed-off-by: Eliza Weisman <[email protected]>
  • Loading branch information
hawkw committed Sep 2, 2021
1 parent 9b04e10 commit f68d5a3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tracing-subscriber/src/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1040,12 +1040,20 @@ where
let alt = f.alternate();
let mut s = f.debug_struct("Layered");
s.field("layer", &self.layer).field("inner", &self.inner);

// These additional fields are more verbose and usually only necessary
// for internal debugging purposes, so only print them if alternate mode
// is enabled.
if alt {
s.field(
"subscriber",
&format_args!("PhantomData<{}>", type_name::<S>()),
);
};
)
.field("has_plf_filter_rules", &self.has_plf_filter_rules)
.field("has_layer_filter", &self.has_layer_filter)
.field("inner_has_layer_filter", &self.inner_has_layer_filter);
}

s.finish()
}
}
Expand Down

0 comments on commit f68d5a3

Please sign in to comment.