Mirror error logs to stderr in TUI mode - #650
Open
Bornoz wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
LogOutput::TUIthe only sink for logs is thetui_loggerwidget, 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-tuisucceeds, and clippy / rustfmt are clean on the changed file.Closes #23