feat: log warning when generating report

This commit is contained in:
ThetaDev 2024-12-18 19:33:43 +01:00
parent 162959ca45
commit 258f18a99d
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6

View file

@ -137,8 +137,12 @@ impl FileReporter {
fn _report(&self, report: &Report) -> Result<(), String> { fn _report(&self, report: &Report) -> Result<(), String> {
let report_path = get_report_path(&self.path, report, "json").map_err(|e| e.to_string())?; let report_path = get_report_path(&self.path, report, "json").map_err(|e| e.to_string())?;
let file = File::create(report_path).map_err(|e| e.to_string())?; let file = File::create(&report_path).map_err(|e| e.to_string())?;
serde_json::to_writer_pretty(&file, &report).map_err(|e| e.to_string())?; serde_json::to_writer_pretty(&file, &report).map_err(|e| e.to_string())?;
tracing::warn!(
"created report: {}",
report_path.to_str().unwrap_or_default()
);
Ok(()) Ok(())
} }
} }