Skip to content

Mirror error logs to stderr in TUI mode - #650

Open
Bornoz wants to merge 1 commit into
PsycheFoundation:mainfrom
Bornoz:fix/tui-mirror-errors-to-stderr
Open

Mirror error logs to stderr in TUI mode#650
Bornoz wants to merge 1 commit into
PsycheFoundation:mainfrom
Bornoz:fix/tui-mirror-errors-to-stderr

Conversation

@Bornoz

@Bornoz Bornoz commented Aug 31, 2026

Copy link
Copy Markdown

In LogOutput::TUI the only sink for logs is the tui_logger widget, drawn inside the alternate screen. When the process exits or panics, the alternate screen is torn down and the widget goes with it, so an error logged just before the exit is gone before it can be read — which is #23.

This adds a second layer in TUI mode that writes error-level events to stderr. Normal logs still go only to the TUI widget; errors also land in the terminal and stay visible once the TUI is gone.

cargo build -p psyche-tui succeeds, and clippy / rustfmt are clean on the changed file.

Closes #23

In LogOutput::TUI the only sink for logs is the tui_logger widget, which is drawn inside the alternate screen. When the process exits or panics, the alternate screen is torn down and the widget's contents go with it, so an error that happened right before the exit is gone before the user can read it.

Add a second layer in TUI mode that writes error-level events to stderr. Regular logs still go only to the TUI widget; errors also land in the terminal, where they remain visible after the TUI is gone. Builds with cargo build -p psyche-tui; clippy and rustfmt are clean on the change.

Closes PsycheFoundation#23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

when TUI is enabled, log errors to the background window anyways

1 participant