bookwyrm/bookwyrm/utils/log.py
Joel Bradshaw 7ae0db7f4a Ignore VariableDoesNotExist errors in debug logging
They're so noisy as to make debug logging useless otherwise
2022-05-30 12:15:50 -07:00

13 lines
382 B
Python

import logging
class IgnoreVariableDoesNotExist(logging.Filter):
def filter(self, record):
if(record.exc_info):
(errType, errValue, _) = record.exc_info
while errValue:
if type(errValue).__name__ == 'VariableDoesNotExist':
return False
errValue = errValue.__context__
return True