From 8474014db4b5b2e4344e4a0cd8ca5f5f9d7fb833 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 13 Oct 2021 14:59:35 -0400 Subject: [PATCH] subscriber: document that directives are comma-separated (#1637) Previously, the documentation explained that an `EnvFilter` consisted of multiple directives, but didn't describe how to actually put these directives together. (My first guess was "with spaces", but that was wrong.) This patch changes the documentation to say that directives are comma-separated, and gives an example of a comma-separated filter. --- tracing-subscriber/src/filter/env/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tracing-subscriber/src/filter/env/mod.rs b/tracing-subscriber/src/filter/env/mod.rs index f983418059..0ac337ea42 100644 --- a/tracing-subscriber/src/filter/env/mod.rs +++ b/tracing-subscriber/src/filter/env/mod.rs @@ -29,7 +29,7 @@ use tracing_core::{ /// /// # Directives /// -/// A filter consists of one or more directives which match on [`Span`]s and [`Event`]s. +/// A filter consists of one or more comma-separated directives which match on [`Span`]s and [`Event`]s. /// Each directive may have a corresponding maximum verbosity [`level`] which /// enables (e.g., _selects for_) spans and events that match. Like `log`, /// `tracing` considers less exclusive levels (like `trace` or `info`) to be more @@ -78,6 +78,9 @@ use tracing_core::{ /// - `tokio::net=info` will enable all spans or events that: /// - have the `tokio::net` target, /// - at the level `info` or above. +/// - `warn,tokio::net=info` will enable all spans and events that: +/// - are at the level `warn` or above, *or* +/// - have the `tokio::net` target at the level `info` or above. /// - `my_crate[span_a]=trace` will enable all spans and events that: /// - are within the `span_a` span or named `span_a` _if_ `span_a` has the target `my_crate`, /// - at the level `trace` or above.