app: read the log the daemon actually writes

The daemon rolls its log at midnight and keeps the --log-file path as a
stem, so it writes logs/daemon.YYYY-MM-DD.log. Reload log read the
literal logs/daemon.log, a path that never exists, so every press failed
with a missing file, and the Log file row named the same path.

Read the newest daily file instead and show that path. Strip the ANSI
colours from what is read too: the file layer had colour on, so lines
already on disk carry escapes the box would draw as noise. record-daemon
writes the file without colour from here on.
This commit is contained in:
vhaudiquet committed 2026-11-24 00:16:08 +01:00
1 parent 85b6602b31
commit 42ba0ce882
2 files changed
+110 -10

No files matched your search

+5 -1
View File
@@ -629,7 +629,11 @@ fn init_logging(level: &str, log_file: Option<&std::path::Path>) {
tracing_subscriber::registry()
.with(filter)
.with(tracing_subscriber::fmt::layer().with_writer(non_blocking))
.with(
tracing_subscriber::fmt::layer()
.with_writer(non_blocking)
.with_ansi(false),
)
.init();
eprintln!("Logging to file: {}", log_path.display());