Skip to content

Commit

Permalink
feat(debug): Include errors in debug log when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Apr 9, 2023
1 parent c920c6f commit 9551239
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib.rs
Expand Up @@ -313,6 +313,11 @@ impl Orogene {
.map(|c| c.join("_logs").join(log_file_name()));
let _guard = oro.setup_logging(log_file.as_deref())?;
oro.execute().await.map_err(|e| {
// We toss this in a debug so execution errors show up in our
// debug logs. Unfortunately, we can't do the same for other
// errors in this method because they all happen before the debug
// log is even set up.
tracing::debug!("{e:?}");
if let Some(log_file) = log_file.as_deref() {
tracing::error!("A debug log was written to {}", log_file.display());
}
Expand Down

0 comments on commit 9551239

Please sign in to comment.