changeset 365:238d06c6603e

Add more information to ECL debug messages
author Thibaut Girka <thib@sitedethib.com>
date Mon, 09 Jul 2012 22:14:55 +0200
parents b07e2f71f240
children 7dc012f631dc
files pytouhou/vm/eclrunner.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pytouhou/vm/eclrunner.py
+++ b/pytouhou/vm/eclrunner.py
@@ -172,10 +172,14 @@ class ECLRunner(object):
                 try:
                     callback = self._handlers[instr_type]
                 except KeyError:
-                    logger.warn('unhandled opcode %d (args: %r)', instr_type, args)
+                    logger.warn('[%d %r - %04d] unhandled opcode %d (args: %r)',
+                                id(self), [self.sub] + [e[0] for e in self.stack],
+                                self.frame, instr_type, args)
                 else:
+                    logger.debug('[%d %r - %04d] ins_%d%r', id(self),
+                                 [self.sub] + [e[0] for e in self.stack],
+                                 self.frame, instr_type, args)
                     callback(self, *args)
-                    logger.debug('executed opcode %d (args: %r)', instr_type, args)
 
         self.frame += 1