summaryrefslogtreecommitdiff
path: root/cli/util/logger.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-08-23 18:07:59 -0400
committerGitHub <noreply@github.com>2024-08-23 22:07:59 +0000
commitbbd3a7e637b0223647405adf76b23092ab957157 (patch)
tree3d9eb32c312ea44767628cf36423937429e0ef4e /cli/util/logger.rs
parent38bc4021e633183f33453a6557cedae4e6ee91d0 (diff)
fix: handle showing warnings while the progress bar is shown (#25187)
Diffstat (limited to 'cli/util/logger.rs')
-rw-r--r--cli/util/logger.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/util/logger.rs b/cli/util/logger.rs
index 4c185f6de..d64e9a707 100644
--- a/cli/util/logger.rs
+++ b/cli/util/logger.rs
@@ -2,6 +2,8 @@
use std::io::Write;
+use super::draw_thread::DrawThread;
+
struct CliLogger(env_logger::Logger);
impl CliLogger {
@@ -21,7 +23,13 @@ impl log::Log for CliLogger {
fn log(&self, record: &log::Record) {
if self.enabled(record.metadata()) {
+ // it was considered to hold the draw thread's internal lock
+ // across logging, but if outputting to stderr blocks then that
+ // could potentially block other threads that access the draw
+ // thread's state
+ DrawThread::hide();
self.0.log(record);
+ DrawThread::show();
}
}