Skip to content

Commit

Permalink
subscriber: document that directives are comma-separated (#1637)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nmathewson authored and hawkw committed Oct 21, 2021
1 parent 8c99844 commit 470661a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tracing-subscriber/src/filter/env/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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
Expand Down Expand Up @@ -77,6 +77,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.
Expand Down

0 comments on commit 470661a

Please sign in to comment.