def filter(self, record: logging.LogRecord): if record.exc_info == (None, None, None): return False else: return True