Skip to content

fix: restore logger level after each CLI invocation - #38

Open
ltsyk wants to merge 1 commit into
click-contrib:masterfrom
ltsyk:fix/reset-log-level-after-invoke
Open

ltsyk wants to merge 1 commit into
click-contrib:masterfrom
ltsyk:fix/reset-log-level-after-invoke

Conversation

@ltsyk

@ltsyk ltsyk commented Jul 30, 2026

Copy link
Copy Markdown

Summary

simple_verbosity_option permanently mutated the logger level, so values leaked across CliRunner invocations in tests.

Change

Record the previous level and restore it with ctx.call_on_close after each invocation.

Test plan

  • Manual pattern: invoke with -v DEBUG then a default invoke → level restored

Fixes #29

Reset log level via ctx.call_on_close (issue click-contrib#29)
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.

Log level is leaking between invokations: hack to force-reset it

1 participant