From 7f0d54433155ec8966e12ff4b7c5f4603c2d143d Mon Sep 17 00:00:00 2001 From: Haider-Ali-DS Date: Fri, 19 Jul 2024 14:57:25 +0500 Subject: [PATCH] Add structured logs --- chronicle/src/tasks/spawner.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/chronicle/src/tasks/spawner.rs b/chronicle/src/tasks/spawner.rs index f1a3803f9..91d290946 100644 --- a/chronicle/src/tasks/spawner.rs +++ b/chronicle/src/tasks/spawner.rs @@ -266,13 +266,15 @@ where Ok(false) => { // unregister member if let Err(e) = self.substrate.submit_unregister_member().await { - tracing::error!("Failed to unregister member: {:?}", e); + tracing::error!(task_id = task_id, "Failed to unregister member: {:?}", e); }; - tracing::warn!("Chronicle balance too low, exiting"); + tracing::warn!(task_id = task_id, "Chronicle balance too low, exiting"); std::process::exit(1); }, Ok(true) => {}, - Err(err) => tracing::error!("Could not fetch account balance: {:?}", err), + Err(err) => { + tracing::error!(task_id = task_id, "Could not fetch account balance: {:?}", err) + }, } let submission = async move {