diff options
author | Alex Auvolat <alex@adnab.me> | 2020-04-21 12:54:55 +0000 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-04-21 12:54:55 +0000 |
commit | cc4f2f1cfb30e3995edf3c1174bd06b4bc0a9bf1 (patch) | |
tree | edf151a855ea4bcc55cad64a959b430e243deffa /src/background.rs | |
parent | 53cf4d1baaa994544c02ec12f4bea28598720aa8 (diff) | |
download | garage-cc4f2f1cfb30e3995edf3c1174bd06b4bc0a9bf1.tar.gz garage-cc4f2f1cfb30e3995edf3c1174bd06b4bc0a9bf1.zip |
Pretty logging
Diffstat (limited to 'src/background.rs')
-rw-r--r-- | src/background.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/background.rs b/src/background.rs index b9a4684a..1f04e49b 100644 --- a/src/background.rs +++ b/src/background.rs @@ -77,9 +77,9 @@ impl BackgroundRunner { let stop_signal = self.stop_signal.clone(); workers.push(tokio::spawn(async move { if let Err(e) = worker(stop_signal).await { - eprintln!("Worker stopped with error: {}, error: {}", name, e); + error!("Worker stopped with error: {}, error: {}", name, e); } else { - println!("Worker exited successfully: {}", name); + info!("Worker exited successfully: {}", name); } })); } @@ -90,11 +90,11 @@ impl BackgroundRunner { let must_exit: bool = *stop_signal.borrow(); if let Some(job) = self.dequeue_job(must_exit).await { if let Err(e) = job.await { - eprintln!("Job failed: {}", e) + error!("Job failed: {}", e) } } else { if must_exit { - eprintln!("Background runner {} exiting", i); + info!("Background runner {} exiting", i); return; } tokio::time::delay_for(Duration::from_secs(1)).await; |