1 | #![cfg (feature = "registry" )] |
2 | use tracing::level_filters::LevelFilter; |
3 | use tracing::Subscriber; |
4 | use tracing_subscriber::prelude::*; |
5 | |
6 | #[test] |
7 | fn just_empty_vec() { |
8 | // Just a None means everything is off |
9 | let subscriber = tracing_subscriber::registry().with(Vec::<LevelFilter>::new()); |
10 | assert_eq!(subscriber.max_level_hint(), Some(LevelFilter::OFF)); |
11 | } |
12 | |
13 | #[test] |
14 | fn layer_and_empty_vec() { |
15 | let subscriber = tracing_subscriber::registry() |
16 | .with(LevelFilter::INFO) |
17 | .with(Vec::<LevelFilter>::new()); |
18 | assert_eq!(subscriber.max_level_hint(), Some(LevelFilter::INFO)); |
19 | } |
20 | |