aboutsummaryrefslogtreecommitdiff
path: root/EventManager.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-08-28 16:35:24 +0100
committerGravatar jesopo2018-08-28 16:35:24 +0100
commitb47bf498303a5e1b9fa31754647693177c076800 (patch)
tree586360fc1180d1370e2d27735ba6767172235430 /EventManager.py
parentChange command.py to use call_limited (diff)
signature
Log event path along with timing in EventHook.call
Diffstat (limited to 'EventManager.py')
-rw-r--r--EventManager.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/EventManager.py b/EventManager.py
index b4045d83..c4504358 100644
--- a/EventManager.py
+++ b/EventManager.py
@@ -117,8 +117,9 @@ class EventHook(object):
def call_limited(self, maximum, **kwargs):
return self._call(kwargs, maximum=maximum)
def _call(self, kwargs, maximum=None):
+ event_path = self._get_path()
self.bot.log.debug("calling event: \"%s\" (params: %s)",
- [self._get_path(), kwargs])
+ [event_path, kwargs])
start = time.monotonic()
event = self._make_event(kwargs)
@@ -144,7 +145,8 @@ class EventHook(object):
end = time.monotonic()
total_milliseconds = (end - start) * 1000
- self.bot.log.debug("event called in %fms", [total_milliseconds])
+ self.bot.log.debug("event \"%s\" called in %fms", [
+ event_path, total_milliseconds])
self.check_purge()