Skip to content

CI ensure there are no duplicate log handlers - #991

Merged
henryiii merged 1 commit into
wntrblm:mainfrom
saucoide:loghandlers
Jul 21, 2025
Merged

CI ensure there are no duplicate log handlers#991
henryiii merged 1 commit into
wntrblm:mainfrom
saucoide:loghandlers

Conversation

@saucoide

Copy link
Copy Markdown
Contributor

related: #989 (comment)

nox tests run setup_logging() multiple times in a session and we end up with multiple duplicate handlers, some of which are already closed, fail and try to log the error, creating a cascade of logs

The change is making sure we get rid of our own handler before creating a new one

@henryiii

Copy link
Copy Markdown
Collaborator

So that's it! I never considered duplicates when trying to debug this.

@henryiii

henryiii commented Jul 21, 2025

Copy link
Copy Markdown
Collaborator

We could also just not do anything if there's already a handler and this gets called. Though I think this is better? You could change the color, etc.

@saucoide

Copy link
Copy Markdown
Contributor Author

i think we do need to re-add them for the tests to work, because of the formatting tests & also there was something weird with (caplog?) maybe closing handlers and this would still try to log to a closed stream

@henryiii
henryiii merged commit 7f93235 into wntrblm:main Jul 21, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants