Skip to content
Snippets Groups Projects
Commit 219ed24e authored by patavirt's avatar patavirt
Browse files

Fixup

parent 2ace6538
No related branches found
No related tags found
No related merge requests found
......@@ -37,14 +37,13 @@ def _init_logging():
class with_log_level(contextlib.ContextDecorator):
def __init__(self, level, old_level=None):
def __init__(self, level):
self._level = level
self._old_level = old_level
def __enter__(self):
cm = with_log_level(self._level, int(logger.level))
logger.setLevel(cm._level)
return cm
self._old_level = int(logger.level)
logger.setLevel(self._level)
return self
def __exit__(self, *exc):
logger.setLevel(self._old_level)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment