summaryrefslogtreecommitdiff
path: root/src/administration_writer.cpp
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2025-09-26 17:58:31 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2025-09-26 17:58:31 +0200
commitfb8361d11bdf8c21d2e9d3b94bae444089ba0d96 (patch)
tree9ab563c0c3eefb71ee4a1db6079d58e377a252a3 /src/administration_writer.cpp
parente2321f28730adcb8d67800a434ebc7d60a6dcccb (diff)
log read and write failures
Diffstat (limited to 'src/administration_writer.cpp')
-rw-r--r--src/administration_writer.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/administration_writer.cpp b/src/administration_writer.cpp
index 75f5daf..c27b3e3 100644
--- a/src/administration_writer.cpp
+++ b/src/administration_writer.cpp
@@ -122,7 +122,8 @@ static bool _administration_writer_delete_entry_by_name(char* entry)
if (zip_entries_delete(zip_write, indices, 1) < 0) result = 0;
zip_close(zip_write);
- log_add("Deleted entry '%s' in %.3fms.", entry, STOPWATCH_TIME);
+ if (result) log_info("Deleted entry '%s' in %.3fms.", entry, STOPWATCH_TIME);
+ else log_error("Failed to delete entry '%s'.", entry);
return result;
}
@@ -487,7 +488,9 @@ bool administration_writer_save_invoice_blocking(invoice inv)
free(file_content);
- log_add("Saved invoice '%s' in %.3fms.", inv.sequential_number, STOPWATCH_TIME);
+ if (result) log_info("Saved invoice '%s' in %.3fms.", inv.sequential_number, STOPWATCH_TIME);
+ else log_error("Failed to save invoice '%s'.", inv.sequential_number);
+
return result;
}
@@ -535,7 +538,9 @@ bool administration_writer_save_project_blocking(project project)
free(file_content);
- log_add("Saved project '%s' in %.3fms.", project.description, STOPWATCH_TIME);
+ if (result) log_info("Saved project '%s' in %.3fms.", project.description, STOPWATCH_TIME);
+ else log_error("Failed to save project '%s'.", project.description);
+
return result;
}
@@ -581,7 +586,9 @@ bool administration_writer_save_cost_center_blocking(cost_center cost)
free(file_content);
- log_add("Saved cost center '%s' in %.3fms.", cost.code, STOPWATCH_TIME);
+ if (result) log_info("Saved cost center '%s' in %.3fms.", cost.code, STOPWATCH_TIME);
+ else log_error("Failed to save cost center '%s'.", cost.code);
+
return result;
}
@@ -628,7 +635,9 @@ bool administration_writer_save_tax_rate_blocking(tax_rate rate)
free(file_content);
- log_add("Saved tax rate '%s/%.1f' in %.3fms.", rate.country_code, rate.rate, STOPWATCH_TIME);
+ if (result) log_info("Saved tax rate '%s/%.1f' in %.3fms.", rate.country_code, rate.rate, STOPWATCH_TIME);
+ else log_error("Failed to save tax rate '%s/%.1f'.", rate.country_code, rate.rate);
+
return result;
}
@@ -686,7 +695,9 @@ bool administration_writer_save_contact_blocking(contact c)
free(file_content);
- log_add("Saved contact '%s' in %.3fms.", c.name, STOPWATCH_TIME);
+ if (result) log_info("Saved contact '%s' in %.3fms.", c.name, STOPWATCH_TIME);
+ else log_error("Failed to save contact '%s'.", c.name);
+
return result;
}
@@ -735,7 +746,9 @@ bool administration_writer_save_all_administration_info_blocking()
free(file_content);
- log_add("Saved administration info in %.3fms.", STOPWATCH_TIME);
+ if (result) log_info("Saved administration info in %.3fms.", STOPWATCH_TIME);
+ else log_error("Failed to save administration info.");
+
return result;
}