class ThreadTrackingHandler(logging.Handler): def __init__(self): if threading is None: raise NotImplementedError("threading module is not available, \ the logging panel cannot be used without it") logging.Handler.__init__(self) self.records = Storage() def emit(self, record, thread=None): self.records.new({'entry': record}) def get_records(self, thread=None): return self.records.get_and_clear()
def __init__(self): if threading is None: raise NotImplementedError("threading module is not available, \ the logging panel cannot be used without it") logging.Handler.__init__(self) self.records = Storage()