mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 09:04:48 -04:00
Move logging utilities out of the side drawer of util/ and into logging/ (#5606)
This commit is contained in:
parent
cb8d568cf9
commit
463b072b12
98 changed files with 249 additions and 233 deletions
|
@ -19,7 +19,8 @@ from six.moves import range
|
|||
from twisted.internet import defer, reactor
|
||||
from twisted.internet.defer import CancelledError
|
||||
|
||||
from synapse.util import Clock, logcontext
|
||||
from synapse.logging.context import LoggingContext
|
||||
from synapse.util import Clock
|
||||
from synapse.util.async_helpers import Linearizer
|
||||
|
||||
from tests import unittest
|
||||
|
@ -51,13 +52,13 @@ class LinearizerTestCase(unittest.TestCase):
|
|||
|
||||
@defer.inlineCallbacks
|
||||
def func(i, sleep=False):
|
||||
with logcontext.LoggingContext("func(%s)" % i) as lc:
|
||||
with LoggingContext("func(%s)" % i) as lc:
|
||||
with (yield linearizer.queue("")):
|
||||
self.assertEqual(logcontext.LoggingContext.current_context(), lc)
|
||||
self.assertEqual(LoggingContext.current_context(), lc)
|
||||
if sleep:
|
||||
yield Clock(reactor).sleep(0)
|
||||
|
||||
self.assertEqual(logcontext.LoggingContext.current_context(), lc)
|
||||
self.assertEqual(LoggingContext.current_context(), lc)
|
||||
|
||||
func(0, sleep=True)
|
||||
for i in range(1, 100):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue