From 265f0d6c5d2dccf03d0ffe496ae483b51c3a2a17 Mon Sep 17 00:00:00 2001 From: Erdem Yerebasmaz Date: Wed, 20 Mar 2024 01:01:37 +0300 Subject: [PATCH] Log node-logs according to their level --- libs/sdk-core/src/breez_services.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/sdk-core/src/breez_services.rs b/libs/sdk-core/src/breez_services.rs index a48d683e3..0ed15c067 100644 --- a/libs/sdk-core/src/breez_services.rs +++ b/libs/sdk-core/src/breez_services.rs @@ -1528,7 +1528,12 @@ impl BreezServices { log_message_res = log_stream.message() => { match log_message_res { Ok(Some(l)) => { - info!("node-logs: {}", l.line); + match l.line.to_ascii_lowercase() { + s if s.starts_with("info") => info!("node-logs: {}", l.line.split_at(4).1.trim_start()), + s if s.starts_with("debug") => debug!("node-logs: {}", l.line.split_at(5).1.trim_start()), + s if s.starts_with("unusual") => trace!("node-logs: {}", l.line.split_at(7).1.trim_start()), + _ => trace!("node-logs: {}", l.line) + } }, // stream is closed, renew it Ok(None) => {