From b2200a869007f1b10b6f7d57618f1fedb3ad8908 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Wed, 20 Feb 2019 11:36:50 +0000 Subject: Logging improvements for the pusher (#4691) --- synapse/push/pusher.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'synapse/push/pusher.py') diff --git a/synapse/push/pusher.py b/synapse/push/pusher.py index fcee6d9d7e..368d5094be 100644 --- a/synapse/push/pusher.py +++ b/synapse/push/pusher.py @@ -52,11 +52,12 @@ class PusherFactory(object): logger.info("defined email pusher type") def create_pusher(self, pusherdict): - logger.info("trying to create_pusher for %r", pusherdict) - - if pusherdict['kind'] in self.pusher_types: - logger.info("found pusher") - return self.pusher_types[pusherdict['kind']](self.hs, pusherdict) + kind = pusherdict['kind'] + f = self.pusher_types.get(kind, None) + if not f: + return None + logger.info("creating %s pusher for %r", kind, pusherdict) + return f(self.hs, pusherdict) def _create_email_pusher(self, _hs, pusherdict): app_name = self._app_name_from_pusherdict(pusherdict) -- cgit 1.5.1