From 4e10e8955b2d3bed56daa8f007befe10e5373efc 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 673dda9b4a..93f44640d0 100644 --- a/tracing-subscriber/src/filter/env/mod.rs +++ b/tracing-subscriber/src/filter/env/mod.rs @@ -446,6 +446,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();