diff pytouhou/vm/eclrunner.py @ 575:e4c9eafab6d0

Don’t log every instruction executed, nobody is interested in that, and demote unhandled opcodes to debug.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 26 Jul 2014 14:46:03 +0200
parents a0fa01cd9f70
children e15672733c93
line wrap: on
line diff
--- a/pytouhou/vm/eclrunner.py
+++ b/pytouhou/vm/eclrunner.py
@@ -59,7 +59,8 @@ class ECLMainRunner(object):
                 try:
                     callback = self.handlers[instr_type]
                 except KeyError:
-                    logger.warn('unhandled main opcode %d (args: %r)', instr_type, args)
+                    logger.debug('[%d - %04d] unhandled main opcode %d (args: %r)',
+                                 id(self), self.frame, instr_type, args)
                 else:
                     callback(self, sub, instr_type, *args)
 
@@ -173,13 +174,10 @@ class ECLRunner(object):
                 try:
                     callback = self.handlers[instr_type]
                 except KeyError:
-                    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)
+                    logger.debug('[%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)
 
         self.frame += 1