From 7caea42573ae797e60f1d64fe413a77e921b681d Mon Sep 17 00:00:00 2001 From: OlivierDehaene <23298448+OlivierDehaene@users.noreply.github.com> Date: Sat, 15 Apr 2023 21:25:02 +0200 Subject: [PATCH] feat(launcher): parse all shard logs --- launcher/src/main.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/launcher/src/main.rs b/launcher/src/main.rs index a598a8bb..f233a674 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -525,7 +525,7 @@ fn shard_manager( "--uds-path".to_string(), uds_path, "--logger-level".to_string(), - "ERROR".to_string(), + "INFO".to_string(), "--json-output".to_string(), ]; @@ -645,8 +645,16 @@ fn shard_manager( // Parse loguru logs if let Ok(value) = serde_json::from_str::(&line.unwrap()) { if let Some(text) = value.get("text") { - // Format escaped newlines - tracing::error!("{}", text.to_string().replace("\\n", "\n")); + let level = value.get("record").unwrap().get("level").unwrap().get("name").unwrap().to_string(); + tracing::error!("{}", level); + if level.eq(&"INFO".to_string()) { + tracing::info!("{}", text.to_string().replace("\\n", "\n")); + } else if level == "WARN".to_string() { + tracing::warn!("{}", text.to_string().replace("\\n", "\n")); + } + else { + tracing::error!("{}", text.to_string().replace("\\n", "\n")); + } } } }