feat(launcher): parse all shard logs

This commit is contained in:
OlivierDehaene 2023-04-15 21:25:02 +02:00
parent 4096ca4eed
commit 7caea42573
1 changed files with 11 additions and 3 deletions

View File

@ -525,7 +525,7 @@ fn shard_manager(
"--uds-path".to_string(), "--uds-path".to_string(),
uds_path, uds_path,
"--logger-level".to_string(), "--logger-level".to_string(),
"ERROR".to_string(), "INFO".to_string(),
"--json-output".to_string(), "--json-output".to_string(),
]; ];
@ -645,11 +645,19 @@ fn shard_manager(
// Parse loguru logs // Parse loguru logs
if let Ok(value) = serde_json::from_str::<Value>(&line.unwrap()) { if let Ok(value) = serde_json::from_str::<Value>(&line.unwrap()) {
if let Some(text) = value.get("text") { if let Some(text) = value.get("text") {
// Format escaped newlines 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")); tracing::error!("{}", text.to_string().replace("\\n", "\n"));
} }
} }
} }
}
}); });
let mut ready = false; let mut ready = false;