-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
subscriber: fix FmtCollector not forwarding max level (#1251)
The `FmtCollector` type is missing a `Collect::max_level_hint method that forwards the inner stack's max level hint. This fixes that, and adds tests. Signed-off-by: Eliza Weisman <[email protected]>
- Loading branch information
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use tracing_subscriber::filter::LevelFilter; | ||
|
||
#[test] | ||
fn fmt_sets_max_level_hint() { | ||
tracing_subscriber::fmt() | ||
.with_max_level(LevelFilter::DEBUG) | ||
.init(); | ||
assert_eq!(LevelFilter::current(), LevelFilter::DEBUG); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use tracing_subscriber::{filter::LevelFilter, prelude::*}; | ||
|
||
#[test] | ||
fn registry_sets_max_level_hint() { | ||
tracing_subscriber::registry() | ||
.with(tracing_subscriber::fmt::layer()) | ||
.with(LevelFilter::DEBUG) | ||
.init(); | ||
assert_eq!(LevelFilter::current(), LevelFilter::DEBUG); | ||
} |