From aa5a4632d2f57a8f4b5e8f33156899b37caea9e3 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Thu, 16 Oct 2025 19:24:47 +0100 Subject: Breathing room --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 4788174..5781b00 100644 --- a/src/main.rs +++ b/src/main.rs @@ -92,6 +92,7 @@ async fn main() -> anyhow::Result<()> { conf_path.push(format!("{PROGRAM}.toml")); let conf = config::load(&conf_path) .with_context(|| format!("Failed to load config: {:?}", &conf_path))?; + stderrlog::new() .color(stderrlog::ColorChoice::Never) .module(module_path!()) @@ -103,9 +104,12 @@ async fn main() -> anyhow::Result<()> { }) .init() .unwrap(); + // TODO: This will print creds trace!("Configuration: {conf:?}"); + let (client, mut event_loop) = conf.mqtt_client(); + for (topic, route) in conf.routes.iter() { if let Err(e) = client.subscribe(topic, route.qos.unwrap_or(conf.qos)).await { warn!("Failed to subscribe to '{topic}': {e:?}"); @@ -113,6 +117,7 @@ async fn main() -> anyhow::Result<()> { debug!("Subscribed to: '{topic}'"); } } + moro_local::async_scope!(|scope| -> anyhow::Result<()> { loop { let notification = event_loop.poll().await; -- cgit v1.2.3-70-g09d2