From fa0c5d59fa786210dbda7d5a55b9e8314dcdd38e Mon Sep 17 00:00:00 2001 From: Ron Waldon-Howe Date: Sat, 16 Nov 2024 10:35:10 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8A=20Use=20`tracing::warn!()`=20not?= =?UTF-8?q?=20`eprintln!()`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/dbus2/busd/pull/159#discussion_r1842109116 --- src/config.rs | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/config.rs b/src/config.rs index 449c905..7616575 100644 --- a/src/config.rs +++ b/src/config.rs @@ -6,6 +6,7 @@ use serde::Deserialize; mod xml; +use tracing::warn; use xml::{ Document, Element, PolicyContext, PolicyElement, RuleAttributes, RuleElement, TypeElement, }; @@ -109,7 +110,7 @@ impl TryFrom for BusConfig { Element::Fork => bc.fork = true, Element::KeepUmask => bc.keep_umask = true, Element::Limit => { - eprintln!("warning: busd does not implement ``"); + warn!("warning: busd does not implement ``"); } Element::Listen(s) => { bc.listen.insert(s); @@ -355,14 +356,10 @@ impl TryFrom for OptionalOperation { // https://github.com/dbus2/busd/issues/79 if value.receive_member.is_some() { - eprintln!( - "warning: busd does not implement `<(allow|deny) receive_member=...`: {value:?}" - ); + warn!("warning: busd does not implement `<(allow|deny) receive_member=...`: {value:?}"); } if value.send_member.is_some() { - eprintln!( - "warning: busd does not implement `<(allow|deny) send_member=...`: {value:?}" - ); + warn!("warning: busd does not implement `<(allow|deny) send_member=...`: {value:?}"); } if has_connect { @@ -401,7 +398,7 @@ impl TryFrom for OptionalPolicy { user: None, .. } => { - eprintln!(r#"warning: busd does not implement ``"#); + warn!(r#"warning: busd does not implement ``"#); Ok(None) } PolicyElement { @@ -507,7 +504,7 @@ impl TryFrom for OptionalRule { .. }) => { // see: https://github.com/dbus2/busd/pull/146#issuecomment-2408429760 - eprintln!( + warn!( r#"warning: eavesdropping is deprecated and ignored: ``"# ); Ok(None) @@ -523,7 +520,7 @@ impl TryFrom for OptionalRule { }, ) => { // see: https://github.com/dbus2/busd/pull/146#issuecomment-2408429760 - eprintln!( + warn!( "warning: explicit policies on replies and errors are deprecated and ignored: ` for OptionalRule { RuleElement::Allow(attrs) => { if attrs.eavesdrop == Some(true) { // see: https://github.com/dbus2/busd/pull/146#issuecomment-2408429760 - eprintln!( + warn!( r#"warning: eavesdropping is deprecated and ignored: ` for OptionalRule { .. }) => { // see: https://github.com/dbus2/busd/pull/146#issuecomment-2408429760 - eprintln!( + warn!( r#"warning: eavesdropping is deprecated and ignored: ` for OptionalRule { }, ) => { // see: https://github.com/dbus2/busd/pull/146#issuecomment-2408429760 - eprintln!( + warn!( "warning: explicit policies on replies and errors are deprecated and ignored: `