fix(tui): stop raw prints from corrupting the TUI

Log lines were painting over the alternate-screen TUI because some
messages bypassed the buffered logger and wrote straight to the
terminal:

- a live println! in GetPeerAddressHandler fired on every peer-address
  lookup (i.e. constantly while browsing/downloading) — routed to the
  buffered debug! logger.
- the TUI's error handlers used eprintln! in the render loop and in
  background search/download worker threads — routed to the buffered
  warn! logger so failures no longer smear the screen.

The logger already defers to a buffer while the TUI holds the screen; the
fix is simply to go through it instead of print!/eprintln!.
This commit is contained in:
michel
2026-07-19 21:22:38 +02:00
parent 34babf5808
commit 9f74300c7a
3 changed files with 16 additions and 11 deletions
@@ -22,7 +22,7 @@ impl MessageHandler<ServerMessage> for GetPeerAddressHandler {
let port = message.read_int32();
let obfuscation_type = message.read_int32();
let obfuscated_port = message.read_int32() as u16;
println!("GetPeerAddressHandler: {username:?}"); // Debug print
crate::debug!("GetPeerAddressHandler: {username:?}");
sender
.send(ServerMessage::GetPeerAddressResponse {