Skip to content

Commit

Permalink
🔊 Use tracing::warn!() not eprintln!()
Browse files Browse the repository at this point in the history
  • Loading branch information
jokeyrhyme committed Nov 15, 2024
1 parent 74fba26 commit fa0c5d5
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use serde::Deserialize;

mod xml;

use tracing::warn;
use xml::{
Document, Element, PolicyContext, PolicyElement, RuleAttributes, RuleElement, TypeElement,
};
Expand Down Expand Up @@ -109,7 +110,7 @@ impl TryFrom<Document> for BusConfig {
Element::Fork => bc.fork = true,
Element::KeepUmask => bc.keep_umask = true,
Element::Limit => {
eprintln!("warning: busd does not implement `<limit>`");
warn!("warning: busd does not implement `<limit>`");
}
Element::Listen(s) => {
bc.listen.insert(s);
Expand Down Expand Up @@ -355,14 +356,10 @@ impl TryFrom<RuleAttributes> 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 {
Expand Down Expand Up @@ -401,7 +398,7 @@ impl TryFrom<PolicyElement> for OptionalPolicy {
user: None,
..
} => {
eprintln!(r#"warning: busd does not implement `<policy at_context="...">`"#);
warn!(r#"warning: busd does not implement `<policy at_context="...">`"#);
Ok(None)
}
PolicyElement {
Expand Down Expand Up @@ -507,7 +504,7 @@ impl TryFrom<RuleElement> for OptionalRule {
..
}) => {
// see: https://github.com/dbus2/busd/pull/146#issuecomment-2408429760
eprintln!(
warn!(
r#"warning: eavesdropping is deprecated and ignored: `<allow eavesdrop="true" />`"#
);
Ok(None)
Expand All @@ -523,15 +520,15 @@ impl TryFrom<RuleElement> 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: `<allow ... (receive|send)_requested_reply=...`"
);
Ok(None)
}
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: `<allow ... eavesdrop="true" ...`"#
);
}
Expand All @@ -545,7 +542,7 @@ impl TryFrom<RuleElement> for OptionalRule {
..
}) => {
// see: https://github.com/dbus2/busd/pull/146#issuecomment-2408429760
eprintln!(
warn!(
r#"warning: eavesdropping is deprecated and ignored: `<deny ... eavesdrop="true" ...`"#
);
Ok(None)
Expand All @@ -561,7 +558,7 @@ impl TryFrom<RuleElement> 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: `<deny ... (receive|send)_requested_reply=...`"
);
Ok(None)
Expand Down

0 comments on commit fa0c5d5

Please sign in to comment.