Skip to content

Commit

Permalink
fix: switch using tracing for error event (#10)
Browse files Browse the repository at this point in the history
Use tracing error events to standardize CLI messages
  • Loading branch information
MatisseB committed Jun 26, 2024
1 parent 68bff19 commit 8971a94
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/bin/lgc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use tracing_subscriber::EnvFilter;
#[tokio::main]
async fn main() {
if let Err(err) = LogCraftCli::init().await {
eprintln!("{err}");
tracing::error!("{err}");
std::process::exit(1);
}
}
Expand Down Expand Up @@ -97,13 +97,12 @@ impl LogCraftCli {
{
Ok(config) => config,
Err(e) => {
eprintln!("error: unable to load configuration: {}", e);
tracing::error!("unable to load configuration: {}", e);
std::process::exit(1)
}
};
} else {
eprintln!(
"error: unable to find configuration file\nRun `lgc init` to initialize a new project");
tracing::error!("unable to find configuration file, run `lgc init` to initialize a new project");
std::process::exit(1)
}
}
Expand Down

0 comments on commit 8971a94

Please sign in to comment.