Mercurial > touhou
comparison 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 |
comparison
equal
deleted
inserted
replaced
574:94229756abd9 | 575:e4c9eafab6d0 |
---|---|
57 | 57 |
58 if frame == self.frame: | 58 if frame == self.frame: |
59 try: | 59 try: |
60 callback = self.handlers[instr_type] | 60 callback = self.handlers[instr_type] |
61 except KeyError: | 61 except KeyError: |
62 logger.warn('unhandled main opcode %d (args: %r)', instr_type, args) | 62 logger.debug('[%d - %04d] unhandled main opcode %d (args: %r)', |
63 id(self), self.frame, instr_type, args) | |
63 else: | 64 else: |
64 callback(self, sub, instr_type, *args) | 65 callback(self, sub, instr_type, *args) |
65 | 66 |
66 if not (self._game.msg_wait or self.boss_wait): | 67 if not (self._game.msg_wait or self.boss_wait): |
67 self.frame += 1 | 68 self.frame += 1 |
171 | 172 |
172 if frame == self.frame: | 173 if frame == self.frame: |
173 try: | 174 try: |
174 callback = self.handlers[instr_type] | 175 callback = self.handlers[instr_type] |
175 except KeyError: | 176 except KeyError: |
176 logger.warn('[%d %r - %04d] unhandled opcode %d (args: %r)', | 177 logger.debug('[%d %r - %04d] unhandled opcode %d (args: %r)', |
177 id(self), [self.sub] + [e[0] for e in self.stack], | 178 id(self), [self.sub] + [e[0] for e in self.stack], |
178 self.frame, instr_type, args) | 179 self.frame, instr_type, args) |
179 else: | 180 else: |
180 logger.debug('[%d %r - %04d] ins_%d%r', id(self), | |
181 [self.sub] + [e[0] for e in self.stack], | |
182 self.frame, instr_type, args) | |
183 callback(self, *args) | 181 callback(self, *args) |
184 | 182 |
185 self.frame += 1 | 183 self.frame += 1 |
186 | 184 |
187 | 185 |