Skip to content

Commit a3f24b3

Browse files
committed
core: fix incorrect docs in tracing_core::LevelFilter (#1692)
Resolves #1669. Namely, I: - fixed the incorrect docs on `LevelFilter`. - Removed a stray backtick on `LevelFilter::current`. - Added a matching backtick in Level's documentation. I did _not_ add example of comparing a level against a `LevelFilter`; I instead pointed readers to Level's documentation.
1 parent d6f5a3f commit a3f24b3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tracing-core/src/metadata.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pub struct Kind(KindInner);
128128
/// verbosity. `Level`s can be compared against [`LevelFilter`]s, and
129129
/// [`LevelFilter`] has a variant for each `Level`, which compares analogously
130130
/// to that level. In addition, [`LevelFilter`] adds a [`LevelFilter::OFF`]
131-
/// variant, which is considered "less verbose" than every other `Level. This is
131+
/// variant, which is considered "less verbose" than every other `Level`. This is
132132
/// intended to allow filters to completely disable tracing in a particular context.
133133
///
134134
/// For example:
@@ -227,14 +227,16 @@ pub struct Level(LevelInner);
227227
/// A filter comparable to a verbosity [`Level`].
228228
///
229229
/// If a [`Level`] is considered less than a `LevelFilter`, it should be
230-
/// considered disabled; if greater than or equal to the `LevelFilter`, that
231-
/// level is enabled.
230+
/// considered enabled; if greater than or equal to the `LevelFilter`,
231+
/// that level is disabled. See [`LevelFilter::current`] for more
232+
/// details.
232233
///
233234
/// Note that this is essentially identical to the `Level` type, but with the
234235
/// addition of an [`OFF`] level that completely disables all trace
235236
/// instrumentation.
236237
///
237-
/// See the documentation for the [`Level`] type for more details.
238+
/// See the documentation for the [`Level`] type to see how `Level`s
239+
/// and `LevelFilter`s interact.
238240
///
239241
/// [`OFF`]: LevelFilter::OFF
240242
#[repr(transparent)]
@@ -584,7 +586,7 @@ impl LevelFilter {
584586
/// Therefore, comparing a given span or event's level to the returned
585587
/// `LevelFilter` **can** be used for determining if something is
586588
/// *disabled*, but **should not** be used for determining if something is
587-
/// *enabled*.`
589+
/// *enabled*.
588590
///
589591
/// [`Level`]: super::Level
590592
/// [collector]: super::Collect

0 commit comments

Comments
 (0)