(self, debugtype, msg)
| 212 | return None |
| 213 | |
| 214 | def debug(self, debugtype, msg): |
| 215 | cur_thread = threading.currentThread() |
| 216 | if not cur_thread in self.debugmessages: |
| 217 | # deque(..., self.debugmsglen) would be handy but was |
| 218 | # introduced in p2.6 only, so we'll need to work around and |
| 219 | # shorten our debugmsg list manually :-( |
| 220 | self.debugmessages[cur_thread] = deque() |
| 221 | self.debugmessages[cur_thread].append("%s: %s" % (debugtype, msg)) |
| 222 | |
| 223 | # Shorten queue if needed |
| 224 | if len(self.debugmessages[cur_thread]) > self.debugmsglen: |
| 225 | self.debugmessages[cur_thread].popleft() |
| 226 | |
| 227 | if debugtype in self.debuglist: # log if we are supposed to do so |
| 228 | self.logger.debug("[%s]: %s" % (debugtype, msg)) |
| 229 | |
| 230 | def add_debug(self, debugtype): |
| 231 | global debugtypes |
no test coverage detected