cleanup worker task logging

In order to avoid name conflicts with WorkerTaskContext

- renamed WorkerTask::log to WorkerTask::log_message

Note: Methods have different fuction signatures

Also renamed WorkerTask::warn to WorkerTask::log_warning for
consistency reasons.

Use the task_log!() and task_warn!() macros more often.
This commit is contained in:
Dietmar Maurer
2021-09-24 09:30:00 +02:00
parent c8449217dc
commit 1ec0d70d09
21 changed files with 210 additions and 183 deletions

View File

@ -528,7 +528,7 @@ impl BackupEnvironment {
self.auth_id.to_string(),
false,
move |worker| {
worker.log("Automatically verifying newly added snapshot");
worker.log_message("Automatically verifying newly added snapshot");
let verify_worker = crate::backup::VerifyWorker::new(worker.clone(), datastore);
@ -548,11 +548,11 @@ impl BackupEnvironment {
}
pub fn log<S: AsRef<str>>(&self, msg: S) {
self.worker.log(msg);
self.worker.log_message(msg);
}
pub fn debug<S: AsRef<str>>(&self, msg: S) {
if self.debug { self.worker.log(msg); }
if self.debug { self.worker.log_message(msg); }
}
pub fn format_response(&self, result: Result<Value, Error>) -> Response<Body> {