Have PanicTB respond to RIVER_DEBUG en var#949
Merged
Conversation
Just a small one, but I was trying to debug an example test and found it to be quite annoying because test output is hidden by necessity so as not to mess with stdout for purposes of the example out matching. I'd previously added a special `WithLog` helper to `PanicTB` to add a logger for this sort of debugging, but it's easy to forget it exists. Here, modify things a bit to try an alternative so that when `RIVER_DEBUG is enabled, `PanicTB` sends logging to stderr (so it doesn't mess with stdout for the example). It might be easy to forget this exists too, but at least it's a convention that exists elsewhere for the test suite already and can be triggered without any code changes.
bgentry
approved these changes
Jun 8, 2025
Contributor
Author
|
thx. |
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.
Just a small one, but I was trying to debug an example test and found it
to be quite annoying because test output is hidden by necessity so as
not to mess with stdout for purposes of the example out matching.
I'd previously added a special
WithLoghelper toPanicTBto add alogger for this sort of debugging, but it's easy to forget it exists.
Here, modify things a bit to try an alternative so that when
RIVER_DEBUG is enabled,PanicTB` sends logging to stderr (so itdoesn't mess with stdout for the example). It might be easy to forget
this exists too, but at least it's a convention that exists elsewhere
for the test suite already and can be triggered without any code
changes.