Skip to content

Commit

Permalink
Switched from using println statements to using the correct tracing s…
Browse files Browse the repository at this point in the history
…tatements
  • Loading branch information
mridang committed Nov 25, 2024
1 parent 86cbf11 commit 68023f3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use gethostname::gethostname;
use reqwest::{Client, Url};
use serde_json::json;
use std::env;
use tracing::{error, info};
use uuid::Uuid;

pub struct ErrorReporter {
Expand Down Expand Up @@ -58,7 +59,7 @@ impl ErrorReporter {
self.ingest_scheme, self.ingest_host, self.ingest_port, self.project_id
);

println!("Sending crash to {}", report_url);
info!("Sending crash to {}", report_url);

match self
.client
Expand Down Expand Up @@ -116,17 +117,17 @@ impl ErrorReporter {
{
Ok(response) => {
if response.status().is_success() {
println!("Reporter report sent successfully.");
info!("Reporter report sent successfully.");
} else {
eprintln!(
error!(
"Failed to send report: {}, {}",
response.status(),
response.text().await.unwrap()
);
}
}
Err(e) => {
eprintln!("Error sending report: {:?}", e);
error!("Error sending report: {:?}", e);
}
};
}
Expand Down

0 comments on commit 68023f3

Please sign in to comment.