Switch back to logging events as 2 messages as a lot of other logs can happen

between the start and end of an event and grouping them together is very useful
This commit is contained in:
jesopo 2018-11-26 14:23:20 +00:00
parent 9e8db0ec62
commit 1b03d31c6b

View file

@ -178,6 +178,8 @@ class EventHook(object):
def _call(self, kwargs: dict, safe: bool, maximum: typing.Optional[int] def _call(self, kwargs: dict, safe: bool, maximum: typing.Optional[int]
) -> typing.List[typing.Any]: ) -> typing.List[typing.Any]:
event_path = self._get_path() event_path = self._get_path()
self.log.trace("calling event: \"%s\" (params: %s)",
[event_path,kwargs])
start = time.monotonic() start = time.monotonic()
event = self._make_event(kwargs) event = self._make_event(kwargs)
@ -195,8 +197,8 @@ class EventHook(object):
raise raise
total_milliseconds = (time.monotonic() - start) * 1000 total_milliseconds = (time.monotonic() - start) * 1000
self.log.trace("called event in %fms: \"%s\" (params: %s)", self.log.trace("event \"%s\" called in %fms",
[total_milliseconds, event_path, kwargs]) [event_path, total_milliseconds])
self.check_purge() self.check_purge()