From f7619c23f18b3a4a248bfba2bfd40cc3379bfa1b Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Fri, 22 Nov 2024 11:15:31 +0100 Subject: [PATCH] Adding an info log on stdout for each node --- binaries/daemon/src/spawn.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/binaries/daemon/src/spawn.rs b/binaries/daemon/src/spawn.rs index 71ab8e47..c5c564b2 100644 --- a/binaries/daemon/src/spawn.rs +++ b/binaries/daemon/src/spawn.rs @@ -290,7 +290,7 @@ pub async fn spawn_node( node_config, }; let stdout_tx = tx.clone(); - + let node_id = node.id.clone(); // Stdout listener stream tokio::spawn(async move { let mut buffer = String::new(); @@ -337,6 +337,11 @@ pub async fn spawn_node( // send the buffered lines let lines = std::mem::take(&mut buffer); + if std::env::var("DORA_QUIET").is_err() { + if lines.len() > 1 { + tracing::info!("log_{}: {}", node_id, &lines[..lines.len() - 1]); + } + } let sent = stdout_tx.send(lines.clone()).await; if sent.is_err() { println!("Could not log: {lines}");