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
This commit is contained in:
OlivierDehaene 2024-09-20 16:59:31 +02:00 committed by GitHub
parent f478aa77ad
commit 7e2d18877e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 4 deletions

View File

@ -1038,11 +1038,13 @@ fn log_lines<R: Sized + Read>(mut bufread: BufReader<R>) {
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();
}
}
}