From 6ed2094b6723e8d7abc9f9bfaa6f0e0c2a1ab5f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Wed, 19 Dec 2018 02:17:12 +0100 Subject: [PATCH] Add more log output when calling handlers --- gajim/common/ged.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gajim/common/ged.py b/gajim/common/ged.py index 157e3f54c..c648396f3 100644 --- a/gajim/common/ged.py +++ b/gajim/common/ged.py @@ -24,6 +24,7 @@ Global Events Dispatcher module. import logging import traceback +import inspect from nbxmpp import NodeProcessed @@ -84,13 +85,19 @@ class GlobalEventsDispatcher: Error: %s''', handler, priority, event_name, error) def raise_event(self, event_name, *args, **kwargs): - log.debug('%s Args: %s', event_name, str(args)) + log.debug('Raise event: %s', event_name) if event_name in self.handlers: node_processed = False # Iterate over a copy of the handlers list, so while iterating # the original handlers list can be modified for _priority, handler in list(self.handlers[event_name]): try: + if inspect.ismethod(handler): + log.debug('Call handler %s on %s', + handler.__name__, + handler.__self__) + else: + log.debug('Call handler %s', handler.__name__) if handler(*args, **kwargs): return True except NodeProcessed: