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,7 +295,7 @@ class SimulationMechanism(Mechanism):
295 295
 
296 296
 class Event(BaseObject):
297 297
     def repr_debug(self) -> str:
298
-        return self.__class__.__name__
298
+        return self.__dict__
299 299
 
300 300
 
301 301
 class Behaviour(BaseObject):

+ 7 - 0
synergine2/terminals.py View File

@@ -172,6 +172,13 @@ class Terminal(BaseObject):
172 172
 
173 173
     def execute_event_handlers(self, events: [Event]):
174 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 182
             for event_class, handlers in self.event_handlers.items():
176 183
                 if isinstance(event, event_class):
177 184
                     for handler in handlers: