Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ debug_logging
Function
debug_logging
example_code/item_082.py:87–94 ·
view source on GitHub ↗
(level)
Source
from the content-addressed store, hash-verified
85
86
@contextmanager
87
def
debug_logging(level):
88
logger = logging.getLogger()
89
old_level = logger.getEffectiveLevel()
90
logger.setLevel(level)
91
try
:
92
yield
93
finally:
94
logger.setLevel(old_level)
95
96
97
print(
"Example 6"
)
Callers
1
item_082.py
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected