mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 14:04:47 -04:00
Drop log level for incorrect logging contexts to WARN if the context is wrong and DEBUG if the context is missing
This commit is contained in:
parent
6fe5899639
commit
15099fade5
1 changed files with 8 additions and 5 deletions
|
@ -55,8 +55,11 @@ class LoggingContext(object):
|
||||||
None to avoid suppressing any exeptions that were thrown.
|
None to avoid suppressing any exeptions that were thrown.
|
||||||
"""
|
"""
|
||||||
if self.thread_local.current_context is not self:
|
if self.thread_local.current_context is not self:
|
||||||
logger.error(
|
if self.thread_local.current_context is self.sentinel:
|
||||||
"Current logging context %s is not the expected context %s",
|
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.thread_local.current_context,
|
||||||
self
|
self
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue