From bd9675c8c757bd049f5418a0455bbe7c3a7d1415 Mon Sep 17 00:00:00 2001 From: OlivierDehaene Date: Fri, 20 Sep 2024 16:59:31 +0200 Subject: [PATCH] fix: wrap python basic logs in debug assertion in launcher (#2539) * fix: wrap python basic logs in debug assertion in launcher * use level filters instead --- launcher/src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/launcher/src/main.rs b/launcher/src/main.rs index ee6b08b5..9e0c23ad 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -1042,11 +1042,13 @@ fn log_lines(mut bufread: BufReader) { Ok(log) => log.trace(), // For interactive debugging ? Err(_) => { - stdout.write_all(line).unwrap(); - if lines.peek().is_some() { - stdout.write_all(b"\n").unwrap(); + if LevelFilter::current() >= tracing::Level::DEBUG { + stdout.write_all(line).unwrap(); + if lines.peek().is_some() { + stdout.write_all(b"\n").unwrap(); + } + stdout.flush().unwrap(); } - stdout.flush().unwrap(); } } }