From 445808dd8fdb6a69aa7c561c9c0ede607fe3131b Mon Sep 17 00:00:00 2001 From: George Malayil Philip Date: Wed, 4 Nov 2020 02:45:15 +0530 Subject: [PATCH] Add additional information to references of my_crate in env_filter docs. --- tracing-subscriber/src/filter/env/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tracing-subscriber/src/filter/env/mod.rs b/tracing-subscriber/src/filter/env/mod.rs index 58a8356c8b..38970ed3eb 100644 --- a/tracing-subscriber/src/filter/env/mod.rs +++ b/tracing-subscriber/src/filter/env/mod.rs @@ -232,6 +232,12 @@ 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, directive: Directive) -> Self { if let Some(stat) = directive.to_static() { self.statics.add(stat)