diff options
Diffstat (limited to 'src/app/mod.rs')
| -rw-r--r-- | src/app/mod.rs | 9 |
1 files changed, 9 insertions, 0 deletions
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(()) } |
