From 734bcd04113703927fe0c3871aab3f712ac84e92 Mon Sep 17 00:00:00 2001 From: Gus Wynn Date: Thu, 30 Jun 2022 14:54:08 -0700 Subject: [PATCH 1/7] fix max_level_hint for empty cases for Option/Vec Subscribe impls --- tracing-subscriber/src/subscribe/mod.rs | 8 +++- .../tests/subscriber_filters/main.rs | 1 + .../tests/subscriber_filters/option.rs | 45 +++++++++++++++++++ .../tests/subscriber_filters/vec.rs | 7 +++ 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 tracing-subscriber/tests/subscriber_filters/option.rs diff --git a/tracing-subscriber/src/subscribe/mod.rs b/tracing-subscriber/src/subscribe/mod.rs index 1715437028..b553e8416d 100644 --- a/tracing-subscriber/src/subscribe/mod.rs +++ b/tracing-subscriber/src/subscribe/mod.rs @@ -1485,7 +1485,10 @@ where fn max_level_hint(&self) -> Option { match self { Some(ref inner) => inner.max_level_hint(), - None => None, + None => { + // There is no underlying `Subscribe` so our max level is OFF + Some(LevelFilter::OFF) + } } } @@ -1690,7 +1693,8 @@ feature! { } fn max_level_hint(&self) -> Option { - let mut max_level = LevelFilter::ERROR; + // Default to `OFF` if there are no underlying `Subscribe`s + let mut max_level = LevelFilter::OFF; for s in self { // NOTE(eliza): this is slightly subtle: if *any* subscriber // returns `None`, we have to return `None`, assuming there is diff --git a/tracing-subscriber/tests/subscriber_filters/main.rs b/tracing-subscriber/tests/subscriber_filters/main.rs index 230563756d..c60a20cf63 100644 --- a/tracing-subscriber/tests/subscriber_filters/main.rs +++ b/tracing-subscriber/tests/subscriber_filters/main.rs @@ -3,6 +3,7 @@ mod support; use self::support::*; mod filter_scopes; +mod option; mod targets; mod trees; mod vec; diff --git a/tracing-subscriber/tests/subscriber_filters/option.rs b/tracing-subscriber/tests/subscriber_filters/option.rs new file mode 100644 index 0000000000..b5b2f58031 --- /dev/null +++ b/tracing-subscriber/tests/subscriber_filters/option.rs @@ -0,0 +1,45 @@ +use super::*; +use tracing::Collect; + +// This test is just used to compare to the tests below +#[test] +fn just_layer() { + let info = subscriber::named("info") + .run() + .with_filter(LevelFilter::INFO) + .boxed(); + + let collector = tracing_subscriber::registry().with(info); + assert_eq!(collector.max_level_hint(), Some(LevelFilter::INFO)); +} + +#[test] +fn layer_and_option_layer() { + let info = subscriber::named("info") + .run() + .with_filter(LevelFilter::INFO) + .boxed(); + + let debug = subscriber::named("debug") + .run() + .with_filter(LevelFilter::DEBUG) + .boxed(); + + let mut collector = tracing_subscriber::registry().with(info).with(Some(debug)); + assert_eq!(collector.max_level_hint(), Some(LevelFilter::DEBUG)); + + let error = subscriber::named("error") + .run() + .with_filter(LevelFilter::ERROR) + .boxed(); + // None means the other layer takes control + collector = tracing_subscriber::registry().with(error).with(None); + assert_eq!(collector.max_level_hint(), Some(LevelFilter::ERROR)); +} + +#[test] +fn just_option_layer() { + // Just a None means everything is off + let collector = tracing_subscriber::registry().with(None::); + assert_eq!(collector.max_level_hint(), Some(LevelFilter::OFF)); +} diff --git a/tracing-subscriber/tests/subscriber_filters/vec.rs b/tracing-subscriber/tests/subscriber_filters/vec.rs index a0a971cf51..4823a5e4a0 100644 --- a/tracing-subscriber/tests/subscriber_filters/vec.rs +++ b/tracing-subscriber/tests/subscriber_filters/vec.rs @@ -115,3 +115,10 @@ fn all_filtered_max_level_hint() { assert_eq!(collector.max_level_hint(), Some(LevelFilter::DEBUG)); } + +#[test] +fn empty_vec() { + // Just a None means everything is off + let collector = tracing_subscriber::registry().with(Vec::::new()); + assert_eq!(collector.max_level_hint(), Some(LevelFilter::OFF)); +} From 219958b86c24ca13efc59c407f814cce9f5b3d78 Mon Sep 17 00:00:00 2001 From: Gus Wynn Date: Thu, 30 Jun 2022 15:24:01 -0700 Subject: [PATCH 2/7] cleanup tests and comments --- tracing-subscriber/src/subscribe/mod.rs | 5 +- .../tests/{subscriber_filters => }/option.rs | 30 ++++- .../tests/subscriber_filters/vec.rs | 124 ------------------ tracing-subscriber/tests/vec.rs | 25 ++++ 4 files changed, 52 insertions(+), 132 deletions(-) rename tracing-subscriber/tests/{subscriber_filters => }/option.rs (57%) delete mode 100644 tracing-subscriber/tests/subscriber_filters/vec.rs create mode 100644 tracing-subscriber/tests/vec.rs diff --git a/tracing-subscriber/src/subscribe/mod.rs b/tracing-subscriber/src/subscribe/mod.rs index b553e8416d..a12d10e271 100644 --- a/tracing-subscriber/src/subscribe/mod.rs +++ b/tracing-subscriber/src/subscribe/mod.rs @@ -1486,7 +1486,8 @@ where match self { Some(ref inner) => inner.max_level_hint(), None => { - // There is no underlying `Subscribe` so our max level is OFF + // There is no inner subscriber, so this subscriber will + // never enable anything. Some(LevelFilter::OFF) } } @@ -1693,7 +1694,7 @@ feature! { } fn max_level_hint(&self) -> Option { - // Default to `OFF` if there are no underlying `Subscribe`s + // Default to `OFF` if there are no underlying subscribers let mut max_level = LevelFilter::OFF; for s in self { // NOTE(eliza): this is slightly subtle: if *any* subscriber diff --git a/tracing-subscriber/tests/subscriber_filters/option.rs b/tracing-subscriber/tests/option.rs similarity index 57% rename from tracing-subscriber/tests/subscriber_filters/option.rs rename to tracing-subscriber/tests/option.rs index b5b2f58031..ba0efddbef 100644 --- a/tracing-subscriber/tests/subscriber_filters/option.rs +++ b/tracing-subscriber/tests/option.rs @@ -1,9 +1,12 @@ -use super::*; +mod support; +use self::support::*; use tracing::Collect; +use tracing_subscriber::{filter, prelude::*, Subscribe}; +use tracing::{level_filters::LevelFilter, Level}; // This test is just used to compare to the tests below #[test] -fn just_layer() { +fn just_subscriber() { let info = subscriber::named("info") .run() .with_filter(LevelFilter::INFO) @@ -14,7 +17,7 @@ fn just_layer() { } #[test] -fn layer_and_option_layer() { +fn subscriber_and_option_some_subscriber() { let info = subscriber::named("info") .run() .with_filter(LevelFilter::INFO) @@ -25,21 +28,36 @@ fn layer_and_option_layer() { .with_filter(LevelFilter::DEBUG) .boxed(); - let mut collector = tracing_subscriber::registry().with(info).with(Some(debug)); + let collector = tracing_subscriber::registry().with(info).with(Some(debug)); assert_eq!(collector.max_level_hint(), Some(LevelFilter::DEBUG)); +} +#[test] +fn subscriber_and_option_none_subscriber() { let error = subscriber::named("error") .run() .with_filter(LevelFilter::ERROR) .boxed(); // None means the other layer takes control - collector = tracing_subscriber::registry().with(error).with(None); + let collector = tracing_subscriber::registry() + .with(error) + .with(None::); assert_eq!(collector.max_level_hint(), Some(LevelFilter::ERROR)); } #[test] -fn just_option_layer() { +fn just_option_some_subscriber() { // Just a None means everything is off let collector = tracing_subscriber::registry().with(None::); assert_eq!(collector.max_level_hint(), Some(LevelFilter::OFF)); } + +#[test] +fn just_option_none_subscriber() { + let error = subscriber::named("error") + .run() + .with_filter(LevelFilter::ERROR) + .boxed(); + let collector = tracing_subscriber::registry().with(Some(error)); + assert_eq!(collector.max_level_hint(), Some(LevelFilter::ERROR)); +} diff --git a/tracing-subscriber/tests/subscriber_filters/vec.rs b/tracing-subscriber/tests/subscriber_filters/vec.rs deleted file mode 100644 index 4823a5e4a0..0000000000 --- a/tracing-subscriber/tests/subscriber_filters/vec.rs +++ /dev/null @@ -1,124 +0,0 @@ -use super::*; -use tracing::Collect; - -#[test] -fn with_filters_unboxed() { - let (trace_subscriber, trace_handle) = subscriber::named("trace") - .event(event::mock().at_level(Level::TRACE)) - .event(event::mock().at_level(Level::DEBUG)) - .event(event::mock().at_level(Level::INFO)) - .done() - .run_with_handle(); - let trace_subscriber = trace_subscriber.with_filter(LevelFilter::TRACE); - - let (debug_subscriber, debug_handle) = subscriber::named("debug") - .event(event::mock().at_level(Level::DEBUG)) - .event(event::mock().at_level(Level::INFO)) - .done() - .run_with_handle(); - let debug_subscriber = debug_subscriber.with_filter(LevelFilter::DEBUG); - - let (info_subscriber, info_handle) = subscriber::named("info") - .event(event::mock().at_level(Level::INFO)) - .done() - .run_with_handle(); - let info_subscriber = info_subscriber.with_filter(LevelFilter::INFO); - - let _collector = tracing_subscriber::registry() - .with(vec![trace_subscriber, debug_subscriber, info_subscriber]) - .set_default(); - - tracing::trace!("hello trace"); - tracing::debug!("hello debug"); - tracing::info!("hello info"); - - trace_handle.assert_finished(); - debug_handle.assert_finished(); - info_handle.assert_finished(); -} - -#[test] -fn with_filters_boxed() { - let (unfiltered_subscriber, unfiltered_handle) = subscriber::named("unfiltered") - .event(event::mock().at_level(Level::TRACE)) - .event(event::mock().at_level(Level::DEBUG)) - .event(event::mock().at_level(Level::INFO)) - .done() - .run_with_handle(); - let unfiltered_subscriber = unfiltered_subscriber.boxed(); - - let (debug_subscriber, debug_handle) = subscriber::named("debug") - .event(event::mock().at_level(Level::DEBUG)) - .event(event::mock().at_level(Level::INFO)) - .done() - .run_with_handle(); - let debug_subscriber = debug_subscriber.with_filter(LevelFilter::DEBUG).boxed(); - - let (target_subscriber, target_handle) = subscriber::named("target") - .event(event::mock().at_level(Level::INFO)) - .done() - .run_with_handle(); - let target_subscriber = target_subscriber - .with_filter(filter::filter_fn(|meta| meta.target() == "my_target")) - .boxed(); - - let _collector = tracing_subscriber::registry() - .with(vec![ - unfiltered_subscriber, - debug_subscriber, - target_subscriber, - ]) - .set_default(); - - tracing::trace!("hello trace"); - tracing::debug!("hello debug"); - tracing::info!(target: "my_target", "hello my target"); - - unfiltered_handle.assert_finished(); - debug_handle.assert_finished(); - target_handle.assert_finished(); -} - -#[test] -fn mixed_max_level_hint() { - let unfiltered = subscriber::named("unfiltered").run().boxed(); - let info = subscriber::named("info") - .run() - .with_filter(LevelFilter::INFO) - .boxed(); - let debug = subscriber::named("debug") - .run() - .with_filter(LevelFilter::DEBUG) - .boxed(); - - let collector = tracing_subscriber::registry().with(vec![unfiltered, info, debug]); - - assert_eq!(collector.max_level_hint(), None); -} - -#[test] -fn all_filtered_max_level_hint() { - let warn = subscriber::named("warn") - .run() - .with_filter(LevelFilter::WARN) - .boxed(); - let info = subscriber::named("info") - .run() - .with_filter(LevelFilter::INFO) - .boxed(); - let debug = subscriber::named("debug") - .run() - .with_filter(LevelFilter::DEBUG) - .boxed(); - - let collector = tracing_subscriber::registry().with(vec![warn, info, debug]); - - assert_eq!(collector.max_level_hint(), Some(LevelFilter::DEBUG)); -} - -#[test] -fn empty_vec() { - // Just a None means everything is off - let collector = tracing_subscriber::registry().with(Vec::::new()); - assert_eq!(collector.max_level_hint(), Some(LevelFilter::OFF)); -} diff --git a/tracing-subscriber/tests/vec.rs b/tracing-subscriber/tests/vec.rs new file mode 100644 index 0000000000..1409c1247f --- /dev/null +++ b/tracing-subscriber/tests/vec.rs @@ -0,0 +1,25 @@ +mod support; +use self::support::*; +use tracing::Collect; +use tracing::{level_filters::LevelFilter, Level}; +use tracing_subscriber::{filter, prelude::*, Subscribe}; + +#[test] +fn just_empty_vec() { + // Just a None means everything is off + let collector = tracing_subscriber::registry().with(Vec::::new()); + assert_eq!(collector.max_level_hint(), Some(LevelFilter::OFF)); +} + +#[test] +fn subscriber_and_empty_vec() { + let info = subscriber::named("info") + .run() + .with_filter(LevelFilter::INFO) + .boxed(); + + let collector = tracing_subscriber::registry() + .with(info) + .with(Vec::::new()); + assert_eq!(collector.max_level_hint(), Some(LevelFilter::INFO)); +} From 4734d09e91e1b306f00d1660810841948011cc1b Mon Sep 17 00:00:00 2001 From: Gus Wynn Date: Thu, 30 Jun 2022 15:27:57 -0700 Subject: [PATCH 3/7] one more try --- .../tests/subscriber_filters/main.rs | 1 - .../tests/subscriber_filters/vec.rs | 124 ++++++++++++++++++ 2 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 tracing-subscriber/tests/subscriber_filters/vec.rs diff --git a/tracing-subscriber/tests/subscriber_filters/main.rs b/tracing-subscriber/tests/subscriber_filters/main.rs index c60a20cf63..230563756d 100644 --- a/tracing-subscriber/tests/subscriber_filters/main.rs +++ b/tracing-subscriber/tests/subscriber_filters/main.rs @@ -3,7 +3,6 @@ mod support; use self::support::*; mod filter_scopes; -mod option; mod targets; mod trees; mod vec; diff --git a/tracing-subscriber/tests/subscriber_filters/vec.rs b/tracing-subscriber/tests/subscriber_filters/vec.rs new file mode 100644 index 0000000000..4823a5e4a0 --- /dev/null +++ b/tracing-subscriber/tests/subscriber_filters/vec.rs @@ -0,0 +1,124 @@ +use super::*; +use tracing::Collect; + +#[test] +fn with_filters_unboxed() { + let (trace_subscriber, trace_handle) = subscriber::named("trace") + .event(event::mock().at_level(Level::TRACE)) + .event(event::mock().at_level(Level::DEBUG)) + .event(event::mock().at_level(Level::INFO)) + .done() + .run_with_handle(); + let trace_subscriber = trace_subscriber.with_filter(LevelFilter::TRACE); + + let (debug_subscriber, debug_handle) = subscriber::named("debug") + .event(event::mock().at_level(Level::DEBUG)) + .event(event::mock().at_level(Level::INFO)) + .done() + .run_with_handle(); + let debug_subscriber = debug_subscriber.with_filter(LevelFilter::DEBUG); + + let (info_subscriber, info_handle) = subscriber::named("info") + .event(event::mock().at_level(Level::INFO)) + .done() + .run_with_handle(); + let info_subscriber = info_subscriber.with_filter(LevelFilter::INFO); + + let _collector = tracing_subscriber::registry() + .with(vec![trace_subscriber, debug_subscriber, info_subscriber]) + .set_default(); + + tracing::trace!("hello trace"); + tracing::debug!("hello debug"); + tracing::info!("hello info"); + + trace_handle.assert_finished(); + debug_handle.assert_finished(); + info_handle.assert_finished(); +} + +#[test] +fn with_filters_boxed() { + let (unfiltered_subscriber, unfiltered_handle) = subscriber::named("unfiltered") + .event(event::mock().at_level(Level::TRACE)) + .event(event::mock().at_level(Level::DEBUG)) + .event(event::mock().at_level(Level::INFO)) + .done() + .run_with_handle(); + let unfiltered_subscriber = unfiltered_subscriber.boxed(); + + let (debug_subscriber, debug_handle) = subscriber::named("debug") + .event(event::mock().at_level(Level::DEBUG)) + .event(event::mock().at_level(Level::INFO)) + .done() + .run_with_handle(); + let debug_subscriber = debug_subscriber.with_filter(LevelFilter::DEBUG).boxed(); + + let (target_subscriber, target_handle) = subscriber::named("target") + .event(event::mock().at_level(Level::INFO)) + .done() + .run_with_handle(); + let target_subscriber = target_subscriber + .with_filter(filter::filter_fn(|meta| meta.target() == "my_target")) + .boxed(); + + let _collector = tracing_subscriber::registry() + .with(vec![ + unfiltered_subscriber, + debug_subscriber, + target_subscriber, + ]) + .set_default(); + + tracing::trace!("hello trace"); + tracing::debug!("hello debug"); + tracing::info!(target: "my_target", "hello my target"); + + unfiltered_handle.assert_finished(); + debug_handle.assert_finished(); + target_handle.assert_finished(); +} + +#[test] +fn mixed_max_level_hint() { + let unfiltered = subscriber::named("unfiltered").run().boxed(); + let info = subscriber::named("info") + .run() + .with_filter(LevelFilter::INFO) + .boxed(); + let debug = subscriber::named("debug") + .run() + .with_filter(LevelFilter::DEBUG) + .boxed(); + + let collector = tracing_subscriber::registry().with(vec![unfiltered, info, debug]); + + assert_eq!(collector.max_level_hint(), None); +} + +#[test] +fn all_filtered_max_level_hint() { + let warn = subscriber::named("warn") + .run() + .with_filter(LevelFilter::WARN) + .boxed(); + let info = subscriber::named("info") + .run() + .with_filter(LevelFilter::INFO) + .boxed(); + let debug = subscriber::named("debug") + .run() + .with_filter(LevelFilter::DEBUG) + .boxed(); + + let collector = tracing_subscriber::registry().with(vec![warn, info, debug]); + + assert_eq!(collector.max_level_hint(), Some(LevelFilter::DEBUG)); +} + +#[test] +fn empty_vec() { + // Just a None means everything is off + let collector = tracing_subscriber::registry().with(Vec::::new()); + assert_eq!(collector.max_level_hint(), Some(LevelFilter::OFF)); +} From d3e9f6b3d6b3554f1290a613e06ba85ed4a5c4a7 Mon Sep 17 00:00:00 2001 From: Gus Wynn Date: Thu, 30 Jun 2022 15:44:11 -0700 Subject: [PATCH 4/7] dont depend on with_filter --- tracing-subscriber/tests/option.rs | 39 +++++++----------------------- tracing-subscriber/tests/vec.rs | 11 +++------ 2 files changed, 12 insertions(+), 38 deletions(-) diff --git a/tracing-subscriber/tests/option.rs b/tracing-subscriber/tests/option.rs index ba0efddbef..ddfe3ea60b 100644 --- a/tracing-subscriber/tests/option.rs +++ b/tracing-subscriber/tests/option.rs @@ -1,63 +1,42 @@ mod support; use self::support::*; use tracing::Collect; -use tracing_subscriber::{filter, prelude::*, Subscribe}; use tracing::{level_filters::LevelFilter, Level}; +use tracing_subscriber::{filter, prelude::*, Subscribe}; // This test is just used to compare to the tests below #[test] fn just_subscriber() { - let info = subscriber::named("info") - .run() - .with_filter(LevelFilter::INFO) - .boxed(); - - let collector = tracing_subscriber::registry().with(info); + let collector = tracing_subscriber::registry().with(LevelFilter::INFO); assert_eq!(collector.max_level_hint(), Some(LevelFilter::INFO)); } #[test] fn subscriber_and_option_some_subscriber() { - let info = subscriber::named("info") - .run() - .with_filter(LevelFilter::INFO) - .boxed(); - - let debug = subscriber::named("debug") - .run() - .with_filter(LevelFilter::DEBUG) - .boxed(); - - let collector = tracing_subscriber::registry().with(info).with(Some(debug)); + let collector = tracing_subscriber::registry() + .with(LevelFilter::INFO) + .with(Some(LevelFilter::DEBUG)); assert_eq!(collector.max_level_hint(), Some(LevelFilter::DEBUG)); } #[test] fn subscriber_and_option_none_subscriber() { - let error = subscriber::named("error") - .run() - .with_filter(LevelFilter::ERROR) - .boxed(); // None means the other layer takes control let collector = tracing_subscriber::registry() - .with(error) - .with(None::); + .with(LevelFilter::ERROR) + .with(None::); assert_eq!(collector.max_level_hint(), Some(LevelFilter::ERROR)); } #[test] fn just_option_some_subscriber() { // Just a None means everything is off - let collector = tracing_subscriber::registry().with(None::); + let collector = tracing_subscriber::registry().with(None::); assert_eq!(collector.max_level_hint(), Some(LevelFilter::OFF)); } #[test] fn just_option_none_subscriber() { - let error = subscriber::named("error") - .run() - .with_filter(LevelFilter::ERROR) - .boxed(); - let collector = tracing_subscriber::registry().with(Some(error)); + let collector = tracing_subscriber::registry().with(Some(LevelFilter::ERROR)); assert_eq!(collector.max_level_hint(), Some(LevelFilter::ERROR)); } diff --git a/tracing-subscriber/tests/vec.rs b/tracing-subscriber/tests/vec.rs index 1409c1247f..69c0e64964 100644 --- a/tracing-subscriber/tests/vec.rs +++ b/tracing-subscriber/tests/vec.rs @@ -7,19 +7,14 @@ use tracing_subscriber::{filter, prelude::*, Subscribe}; #[test] fn just_empty_vec() { // Just a None means everything is off - let collector = tracing_subscriber::registry().with(Vec::::new()); + let collector = tracing_subscriber::registry().with(Vec::::new()); assert_eq!(collector.max_level_hint(), Some(LevelFilter::OFF)); } #[test] fn subscriber_and_empty_vec() { - let info = subscriber::named("info") - .run() - .with_filter(LevelFilter::INFO) - .boxed(); - let collector = tracing_subscriber::registry() - .with(info) - .with(Vec::::new()); + .with(LevelFilter::INFO) + .with(Vec::::new()); assert_eq!(collector.max_level_hint(), Some(LevelFilter::INFO)); } From 291b25a135a929be762948944bfb3b225ea0373d Mon Sep 17 00:00:00 2001 From: Gus Wynn Date: Thu, 30 Jun 2022 16:04:19 -0700 Subject: [PATCH 5/7] lint --- tracing-subscriber/tests/option.rs | 6 ++---- tracing-subscriber/tests/vec.rs | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tracing-subscriber/tests/option.rs b/tracing-subscriber/tests/option.rs index ddfe3ea60b..f17bb70202 100644 --- a/tracing-subscriber/tests/option.rs +++ b/tracing-subscriber/tests/option.rs @@ -1,8 +1,6 @@ -mod support; -use self::support::*; +use tracing::level_filters::LevelFilter; use tracing::Collect; -use tracing::{level_filters::LevelFilter, Level}; -use tracing_subscriber::{filter, prelude::*, Subscribe}; +use tracing_subscriber::prelude::*; // This test is just used to compare to the tests below #[test] diff --git a/tracing-subscriber/tests/vec.rs b/tracing-subscriber/tests/vec.rs index 69c0e64964..a089e6e7b9 100644 --- a/tracing-subscriber/tests/vec.rs +++ b/tracing-subscriber/tests/vec.rs @@ -1,8 +1,6 @@ -mod support; -use self::support::*; +use tracing::level_filters::LevelFilter; use tracing::Collect; -use tracing::{level_filters::LevelFilter, Level}; -use tracing_subscriber::{filter, prelude::*, Subscribe}; +use tracing_subscriber::prelude::*; #[test] fn just_empty_vec() { From 8a9411842376e5df9a88d22aff7c3bf5649ca17a Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Thu, 30 Jun 2022 16:26:08 -0700 Subject: [PATCH 6/7] fix feature flags for tests --- tracing-subscriber/tests/option.rs | 1 + tracing-subscriber/tests/vec.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/tracing-subscriber/tests/option.rs b/tracing-subscriber/tests/option.rs index f17bb70202..574b087296 100644 --- a/tracing-subscriber/tests/option.rs +++ b/tracing-subscriber/tests/option.rs @@ -1,3 +1,4 @@ +#![feature = "registry"] use tracing::level_filters::LevelFilter; use tracing::Collect; use tracing_subscriber::prelude::*; diff --git a/tracing-subscriber/tests/vec.rs b/tracing-subscriber/tests/vec.rs index a089e6e7b9..1d651fcdee 100644 --- a/tracing-subscriber/tests/vec.rs +++ b/tracing-subscriber/tests/vec.rs @@ -1,3 +1,4 @@ +#![feature = "registry"] use tracing::level_filters::LevelFilter; use tracing::Collect; use tracing_subscriber::prelude::*; From 8429efd11803fff143ba854b7c775822f25f78fa Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Thu, 30 Jun 2022 17:02:15 -0700 Subject: [PATCH 7/7] oops lol Signed-off-by: Eliza Weisman --- tracing-subscriber/tests/option.rs | 2 +- tracing-subscriber/tests/vec.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tracing-subscriber/tests/option.rs b/tracing-subscriber/tests/option.rs index 574b087296..a0f127e286 100644 --- a/tracing-subscriber/tests/option.rs +++ b/tracing-subscriber/tests/option.rs @@ -1,4 +1,4 @@ -#![feature = "registry"] +#![cfg(feature = "registry")] use tracing::level_filters::LevelFilter; use tracing::Collect; use tracing_subscriber::prelude::*; diff --git a/tracing-subscriber/tests/vec.rs b/tracing-subscriber/tests/vec.rs index 1d651fcdee..4ea9c3db87 100644 --- a/tracing-subscriber/tests/vec.rs +++ b/tracing-subscriber/tests/vec.rs @@ -1,4 +1,4 @@ -#![feature = "registry"] +#![cfg(feature = "registry")] use tracing::level_filters::LevelFilter; use tracing::Collect; use tracing_subscriber::prelude::*;