This commit is contained in:
parent
1f25b001e6
commit
5ed65713d3
|
|
@ -80,7 +80,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||||
logger.log_error(&format!("Failed to write antares.json: {}", e));
|
logger.log_error(&format!("Failed to write antares.json: {}", e));
|
||||||
Box::new(std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))
|
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
|
items
|
||||||
}
|
}
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
|
|
@ -109,10 +109,10 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||||
// Export to Excel
|
// Export to Excel
|
||||||
match export_to_excel(&items, &out_path) {
|
match export_to_excel(&items, &out_path) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
logger.log_export_success(&out_path, items.len());
|
logger.log(&format!("✓ Export successful - {} rows exported to {}", items.len(), out_path));
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
logger.log_export_failure(&e.to_string());
|
logger.log_error(&format!("✗ Export failed: {}", e));
|
||||||
return Err(e);
|
return Err(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
pub fn log_info(&self, message: &str) {
|
||||||
self.log(&format!("ℹ {}", message));
|
self.log(&format!("ℹ {}", message));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue