From f22f2861e017057fc34dd13c224ca6c9881db643 Mon Sep 17 00:00:00 2001 From: George Malayil Philip Date: Tue, 10 May 2022 03:53:57 +0530 Subject: [PATCH] Add additional information to references of my_crate in env_filter docs. (#1088) Co-authored-by: Bryan Garza <1396101+bryangarza@users.noreply.github.com> --- tracing-subscriber/src/filter/env/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tracing-subscriber/src/filter/env/mod.rs b/tracing-subscriber/src/filter/env/mod.rs index dae20a6a2e..81a9ae2bde 100644 --- a/tracing-subscriber/src/filter/env/mod.rs +++ b/tracing-subscriber/src/filter/env/mod.rs @@ -449,6 +449,11 @@ impl EnvFilter { /// # Ok(()) /// # } /// ``` + /// In the above example, substitute `my_crate`, `module`, etc. with the + /// name your target crate/module is imported with. This might be + /// different from the package name in Cargo.toml (`-` is replaced by `_`). + /// Example, if the package name in your Cargo.toml is `MY-FANCY-LIB`, then + /// the corresponding Rust identifier would be `MY_FANCY_LIB`: pub fn add_directive(mut self, mut directive: Directive) -> Self { if !self.regex { directive.deregexify();