Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a context manager to temporarily set the logging verbosity #92

Open
Zethson opened this issue Nov 7, 2024 · 0 comments
Open

Add a context manager to temporarily set the logging verbosity #92

Zethson opened this issue Nov 7, 2024 · 0 comments
Assignees

Comments

@Zethson
Copy link
Member

Zethson commented Nov 7, 2024

@contextmanager
def set_verbosity(level):
    original_verbosity = settings.verbosity
    settings.verbosity = level
    yield
    settings.verbosity = original_verbosity

can come in quite handy

@Zethson Zethson self-assigned this Nov 7, 2024
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

No branches or pull requests

1 participant