This commit is contained in:
Villers Krisztián 2026-05-04 15:40:05 +02:00
parent 1f25b001e6
commit 5ed65713d3
2 changed files with 3 additions and 21 deletions

View File

@ -80,7 +80,7 @@ fn main() -> Result<(), Box<dyn Error>> {
logger.log_error(&format!("Failed to write antares.json: {}", e));
Box::new(std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))
})?;
logger.log_api_success(items.len());
logger.log(&format!("API call successful - Fetched {} items", items.len()));
items
}
Err(_) => {
@ -109,10 +109,10 @@ fn main() -> Result<(), Box<dyn Error>> {
// Export to Excel
match export_to_excel(&items, &out_path) {
Ok(_) => {
logger.log_export_success(&out_path, items.len());
logger.log(&format!("✓ Export successful - {} rows exported to {}", items.len(), out_path));
}
Err(e) => {
logger.log_export_failure(&e.to_string());
logger.log_error(&format!("✗ Export failed: {}", e));
return Err(e);
}
}

View File

@ -33,24 +33,6 @@ impl Logger {
}
}
pub fn log_api_success(&self, item_count: usize) {
self.log(&format!(
"✓ API call successful - Fetched {} items",
item_count
));
}
pub fn log_export_success(&self, filepath: &str, row_count: usize) {
self.log(&format!(
"✓ Export successful - {} rows exported to {}",
row_count, filepath
));
}
pub fn log_export_failure(&self, error: &str) {
self.log(&format!("✗ Export failed: {}", error));
}
pub fn log_info(&self, message: &str) {
self.log(&format!(" {}", message));
}