Browse Source

improve terminal debug log

Bastien Sevajol 6 years ago
parent
commit
b2cd0eac74
2 changed files with 8 additions and 1 deletions
  1. 1 1
      synergine2/simulation.py
  2. 7 0
      synergine2/terminals.py

+ 1 - 1
synergine2/simulation.py View File

295
 
295
 
296
 class Event(BaseObject):
296
 class Event(BaseObject):
297
     def repr_debug(self) -> str:
297
     def repr_debug(self) -> str:
298
-        return self.__class__.__name__
298
+        return self.__dict__
299
 
299
 
300
 
300
 
301
 class Behaviour(BaseObject):
301
 class Behaviour(BaseObject):

+ 7 - 0
synergine2/terminals.py View File

172
 
172
 
173
     def execute_event_handlers(self, events: [Event]):
173
     def execute_event_handlers(self, events: [Event]):
174
         for event in events:
174
         for event in events:
175
+            self.logger.debug(
176
+                'Event "{}" received with data: {}'.format(
177
+                    event.__class__.__name__,
178
+                    event.repr_debug()
179
+                ),
180
+            )
181
+
175
             for event_class, handlers in self.event_handlers.items():
182
             for event_class, handlers in self.event_handlers.items():
176
                 if isinstance(event, event_class):
183
                 if isinstance(event, event_class):
177
                     for handler in handlers:
184
                     for handler in handlers: