From f74c9a3b7879d37b5392c999fc7cdba16d93bef7 Mon Sep 17 00:00:00 2001 From: Chris Stones Date: Thu, 16 Mar 2023 17:44:52 +0000 Subject: [PATCH 1/2] Add missing scope in ConfigBuilder add_allow_str example. --- src/config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index e18ccb37..3f6b8a01 100644 --- a/src/config.rs +++ b/src/config.rs @@ -256,7 +256,7 @@ impl ConfigBuilder { /// Add allowed module filters. /// If any are specified, only records from modules starting with one of these entries will be printed /// - /// For example, `add_filter_allow(format!("{}{}","tokio", "uds"))` would allow only logging from the `tokio` crates `uds` module. + /// For example, `add_filter_allow(format!("{}::{}","tokio", "uds"))` would allow only logging from the `tokio` crates `uds` module. pub fn add_filter_allow(&mut self, filter_allow: String) -> &mut ConfigBuilder { let mut list = Vec::from(&*self.0.filter_allow); list.push(Cow::Owned(filter_allow)); @@ -285,7 +285,7 @@ impl ConfigBuilder { /// Add denied module filters. /// If any are specified, records from modules starting with one of these entries will be ignored /// - /// For example, `add_filter_ignore(format!("{}{}","tokio", "uds"))` would deny logging from the `tokio` crates `uds` module. + /// For example, `add_filter_ignore(format!("{}::{}","tokio", "uds"))` would deny logging from the `tokio` crates `uds` module. pub fn add_filter_ignore(&mut self, filter_ignore: String) -> &mut ConfigBuilder { let mut list = Vec::from(&*self.0.filter_ignore); list.push(Cow::Owned(filter_ignore)); From 6ec2061742d89174c8a60aa8ade44e51333d44fd Mon Sep 17 00:00:00 2001 From: Chris Stones Date: Thu, 16 Mar 2023 17:47:32 +0000 Subject: [PATCH 2/2] Adjust add_filter_allow / add_filter_ignore documentation to reference target, rather than module. From commit 7648343bd71dd2a631fb063a76af63a07d6cf754 onwards, filtering operates on the target, rather than module path. --- src/config.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/config.rs b/src/config.rs index 3f6b8a01..050dd90a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -242,8 +242,8 @@ impl ConfigBuilder { self } - /// Add allowed module filters. - /// If any are specified, only records from modules starting with one of these entries will be printed + /// Add allowed target filters. + /// If any are specified, only records from targets matching one of these entries will be printed /// /// For example, `add_filter_allow_str("tokio::uds")` would allow only logging from the `tokio` crates `uds` module. pub fn add_filter_allow_str(&mut self, filter_allow: &'static str) -> &mut ConfigBuilder { @@ -253,8 +253,8 @@ impl ConfigBuilder { self } - /// Add allowed module filters. - /// If any are specified, only records from modules starting with one of these entries will be printed + /// Add allowed target filters. + /// If any are specified, only records from targets matching one of these entries will be printed /// /// For example, `add_filter_allow(format!("{}::{}","tokio", "uds"))` would allow only logging from the `tokio` crates `uds` module. pub fn add_filter_allow(&mut self, filter_allow: String) -> &mut ConfigBuilder { @@ -264,15 +264,15 @@ impl ConfigBuilder { self } - /// Clear allowed module filters. + /// Clear allowed target filters. /// If none are specified, nothing is filtered out pub fn clear_filter_allow(&mut self) -> &mut ConfigBuilder { self.0.filter_allow = Cow::Borrowed(&[]); self } - /// Add denied module filters. - /// If any are specified, records from modules starting with one of these entries will be ignored + /// Add denied target filters. + /// If any are specified, records from targets matching one of these entries will be ignored /// /// For example, `add_filter_ignore_str("tokio::uds")` would deny logging from the `tokio` crates `uds` module. pub fn add_filter_ignore_str(&mut self, filter_ignore: &'static str) -> &mut ConfigBuilder { @@ -282,8 +282,8 @@ impl ConfigBuilder { self } - /// Add denied module filters. - /// If any are specified, records from modules starting with one of these entries will be ignored + /// Add denied target filters. + /// If any are specified, records from targets matching one of these entries will be ignored /// /// For example, `add_filter_ignore(format!("{}::{}","tokio", "uds"))` would deny logging from the `tokio` crates `uds` module. pub fn add_filter_ignore(&mut self, filter_ignore: String) -> &mut ConfigBuilder { @@ -293,7 +293,7 @@ impl ConfigBuilder { self } - /// Clear ignore module filters. + /// Clear ignore target filters. /// If none are specified, nothing is filtered pub fn clear_filter_ignore(&mut self) -> &mut ConfigBuilder { self.0.filter_ignore = Cow::Borrowed(&[]);