Skip to content

Commit

Permalink
supervisor: reduce verbosity (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheButlah authored Aug 8, 2024
1 parent 83dd83d commit 6555ad5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Type=dbus
BusName=org.worldcoin.OrbSupervisor1
SyslogIdentifier=worldcoin-supervisor
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/worldcoin_bus_socket
Environment="RUST_LOG=debug"
ExecStart=/usr/local/bin/orb-supervisor

[Install]
Expand Down
6 changes: 3 additions & 3 deletions orb-supervisor/src/shutdown.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{cmp::Ordering, fmt::Display, str::FromStr};

use tracing::info;
use tracing::debug;
use zbus_systemd::login1::{self};
use Kind::{DryHalt, DryPoweroff, DryReboot, Halt, Poweroff, Reboot};

Expand Down Expand Up @@ -128,7 +128,7 @@ pub async fn schedule_shutdown(
shutdown_req: ScheduledShutdown,
) -> zbus::Result<PreemptionInfo> {
let already_scheduled: Option<ScheduledShutdown> = {
info!("getting property `org.freedesktop.login1.Manager.ScheduledShutdown`");
debug!("getting property `org.freedesktop.login1.Manager.ScheduledShutdown`");
let raw_tuple = proxy.scheduled_shutdown().await?;
ScheduledShutdown::try_from_dbus(raw_tuple)
.expect("infallible, the result should always parse")
Expand All @@ -143,7 +143,7 @@ pub async fn schedule_shutdown(
PreemptionInfo::NoExistingShutdown
};

info!(
debug!(
"calling `org.freedesktop.login1.Manager.ScheduleShutdown` to shutdown system"
);
proxy
Expand Down
7 changes: 3 additions & 4 deletions orb-supervisor/src/tasks/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use tokio::{
task::JoinHandle,
time::{self, error::Elapsed, Instant},
};
use tracing::{debug, info, instrument, warn};
use tracing::{debug, info, instrument, trace, warn};
use zbus_systemd::systemd1::{self, ManagerProxy};

use crate::consts::{
Expand Down Expand Up @@ -45,7 +45,7 @@ pub fn spawn_shutdown_worldcoin_core_timer(

// reset the trigger if a new signup has started
_ = last_signup_started_event.changed() => {
info!(
debug!(
duration_s = DURATION_TO_STOP_CORE_AFTER_LAST_SIGNUP.as_secs(),
"new signup started, resetting timer",
);
Expand Down Expand Up @@ -149,12 +149,11 @@ async fn has_worldcoin_core_stopped(proxy: ManagerProxy<'static>) -> Result<(),
// This makes use of the fact that the first iteration always returns the current state.
// So if the service is already inactive or failed, then this loop will break and we
// doesn't spin indefinitely.
debug!("spinning");
while let Some(event) = active_state_stream.next().await {
match &*event.get().await? {
"inactive" | "failed" => break,
other => {
info!(event = other, "received event");
trace!(event = other, "received event");
}
}
}
Expand Down

0 comments on commit 6555ad5

Please sign in to comment.