diff options
author | Erik Johnston <erik@matrix.org> | 2016-02-03 13:51:25 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-02-03 13:52:27 +0000 |
commit | d4f72a5bfb95d07d5af3f49c736823840659101a (patch) | |
tree | 3f416fc10ee4fa5d24aae454a3b089fcc99fe6a5 /synapse/handlers | |
parent | Merge pull request #553 from matrix-org/daniel/accesstokenlogging (diff) | |
download | synapse-d4f72a5bfb95d07d5af3f49c736823840659101a.tar.xz |
Allowing tagging log contexts
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/sync.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index dc686db541..72ccaf1e3f 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -18,6 +18,7 @@ from ._base import BaseHandler from synapse.streams.config import PaginationConfig from synapse.api.constants import Membership, EventTypes from synapse.util import unwrapFirstError +from synapse.util.logcontext import LoggingContext from twisted.internet import defer @@ -140,6 +141,15 @@ class SyncHandler(BaseHandler): A Deferred SyncResult. """ + context = LoggingContext.current_context() + if context: + if since_token is None: + context.tag = "initial_sync" + elif full_state: + context.tag = "full_state_sync" + else: + context.tag = "incremental_sync" + if timeout == 0 or since_token is None or full_state: # we are going to return immediately, so don't bother calling # notifier.wait_for_events. |