Skip to content

Have PanicTB respond to RIVER_DEBUG en var#949

Merged
brandur merged 1 commit into
masterfrom
brandur-river-debug-panic-tb
Jun 10, 2025
Merged

Have PanicTB respond to RIVER_DEBUG en var#949
brandur merged 1 commit into
masterfrom
brandur-river-debug-panic-tb

Conversation

@brandur

@brandur brandur commented Jun 8, 2025

Copy link
Copy Markdown
Contributor

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.

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.
@brandur brandur requested a review from bgentry June 8, 2025 10:49
@brandur

brandur commented Jun 10, 2025

Copy link
Copy Markdown
Contributor Author

thx.

@brandur brandur merged commit f0e6b00 into master Jun 10, 2025
10 checks passed
@brandur brandur deleted the brandur-river-debug-panic-tb branch June 10, 2025 00:03
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.

2 participants