From 0952686526e118339b945ccfb84db1dcc69ee2ab Mon Sep 17 00:00:00 2001 From: Kevin Hoerr Date: Wed, 22 Apr 2026 14:52:59 -0400 Subject: Add logging --- src/app/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/app/mod.rs') diff --git a/src/app/mod.rs b/src/app/mod.rs index 15290ef..d51640f 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -34,6 +34,7 @@ impl App { } pub fn exit(&mut self) -> Result<()> { + tracing::event!(tracing::Level::TRACE, exit = true, "Changing exit status."); self.exit = true; Ok(()) } @@ -42,6 +43,7 @@ impl App { let store = self.context.unwrap_store(); let count = store.get_counter()?; + tracing::event!(tracing::Level::TRACE, count, "Decrementing counter."); if count == 0 { Err(OverflowError { _msg: "Cannot count below 0".into(), @@ -57,6 +59,7 @@ impl App { let store = self.context.unwrap_store(); let count = store.get_counter()?; + tracing::event!(tracing::Level::TRACE, count, "Incrementing counter."); if count == u8::MAX { Err(OverflowError { _msg: "Cannot count above u8::MAX".into(), @@ -77,6 +80,12 @@ impl App { } pub fn set_error(&mut self, error: ErrReport) -> Result<()> { + tracing::event!( + tracing::Level::ERROR, + error = error.to_string(), + help = error.help().map_or(String::default(), |h| h.to_string()) + ); + self.error = Some(error); Ok(()) } -- cgit v1.3