1
0
Fork 0

Ignore VariableDoesNotExist errors in debug logging

They're so noisy as to make debug logging useless otherwise
This commit is contained in:
Joel Bradshaw 2022-05-05 13:29:07 -07:00
parent 7905be7de2
commit 7ae0db7f4a
2 changed files with 16 additions and 0 deletions

12
bookwyrm/utils/log.py Normal file
View file

@ -0,0 +1,12 @@
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