diff --git a/src/job.rs b/src/job.rs index a590e1e13..ced0339e4 100644 --- a/src/job.rs +++ b/src/job.rs @@ -4,6 +4,7 @@ //! and job types. use std::time::Duration; +use std::*; use deltachat_derive::{FromSql, ToSql}; use rand::{thread_rng, Rng}; @@ -123,6 +124,12 @@ pub struct Job { pub pending_error: Option, } +impl fmt::Display for Job { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "#{}, action {}", self.job_id, self.action) + } +} + impl Job { /// Deletes the job from the database. fn delete(&self, context: &Context) -> bool { @@ -733,13 +740,7 @@ fn job_perform(context: &Context, thread: Thread, probe_network: bool) { let jobs: Vec = load_jobs(context, thread, probe_network); for mut job in jobs { - info!( - context, - "{}-job #{}, action {} started...", - thread, - job.job_id, - job.action, - ); + info!(context, "{}-job {} started...", thread, job); // some configuration jobs are "exclusive": // - they are always executed in the imap-thread and the smtp-thread is suspended during execution