From 6daa5202b1dd0f50818ed496367af0bcc1e5022e Mon Sep 17 00:00:00 2001 From: Priec Date: Fri, 12 Sep 2025 18:17:52 +0200 Subject: [PATCH] debug is now running properly in the background without any issues --- client/src/utils/debug_logger.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/client/src/utils/debug_logger.rs b/client/src/utils/debug_logger.rs index 6757f5b..5d96d18 100644 --- a/client/src/utils/debug_logger.rs +++ b/client/src/utils/debug_logger.rs @@ -33,8 +33,18 @@ impl io::Write for UiDebugWriter { let message = String::from_utf8_lossy(buf).trim().to_string(); let is_error = message.starts_with("ERROR"); - // Always keep in memory - buffer.push_back((message, is_error)); + // Keep in memory for UI + buffer.push_back((message.clone(), is_error)); + + // ALSO log directly to file (non-blocking best effort) + if let Ok(mut file) = OpenOptions::new() + .create(true) + .append(true) + .open("ui_debug.log") + { + let _ = writeln!(file, "{message}"); + } + Ok(buf.len()) }