Skip to content
Snippets Groups Projects
Commit 15099fad authored by Mark Haines's avatar Mark Haines
Browse files

Drop log level for incorrect logging contexts to WARN if the context is wrong...

Drop log level for incorrect logging contexts to WARN if the context is wrong and DEBUG if the context is missing
parent 6fe58996
No related branches found
Tags v0.12.0-rc3
No related merge requests found
......@@ -55,11 +55,14 @@ class LoggingContext(object):
None to avoid suppressing any exeptions that were thrown.
"""
if self.thread_local.current_context is not self:
logger.error(
"Current logging context %s is not the expected context %s",
self.thread_local.current_context,
self
)
if self.thread_local.current_context is self.sentinel:
logger.debug("Expected logging context %s has been lost", self)
else:
logger.warn(
"Current logging context %s is not expected context %s",
self.thread_local.current_context,
self
)
self.thread_local.current_context = self.parent_context
self.parent_context = None
......
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