mirror of
https://github.com/morpheus65535/bazarr
synced 2025-02-23 06:21:05 +00:00
Merge remote-tracking branch 'origin/development' into development
This commit is contained in:
commit
163a7834d2
1 changed files with 31 additions and 0 deletions
|
@ -56,6 +56,36 @@ class NoExceptionFormatter(logging.Formatter):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
||||||
|
class UnwantedWaitressMessageFilter(logging.Filter):
|
||||||
|
def filter(self, record):
|
||||||
|
if settings.general.debug == True:
|
||||||
|
# no filtering in debug mode
|
||||||
|
return True
|
||||||
|
|
||||||
|
unwantedMessages = [
|
||||||
|
"Exception while serving /api/socket.io/",
|
||||||
|
['Session is disconnected', 'Session not found' ],
|
||||||
|
|
||||||
|
"Exception while serving /api/socket.io/",
|
||||||
|
["'Session is disconnected'", "'Session not found'" ],
|
||||||
|
|
||||||
|
"Exception while serving /api/socket.io/",
|
||||||
|
['"Session is disconnected"', '"Session not found"' ]
|
||||||
|
]
|
||||||
|
|
||||||
|
wanted = True
|
||||||
|
listLength = len(unwantedMessages)
|
||||||
|
for i in range(0, listLength, 2):
|
||||||
|
if record.msg == unwantedMessages[i]:
|
||||||
|
exceptionTuple = record.exc_info
|
||||||
|
if exceptionTuple != None:
|
||||||
|
if str(exceptionTuple[1]) in unwantedMessages[i+1]:
|
||||||
|
wanted = False
|
||||||
|
break
|
||||||
|
|
||||||
|
return wanted
|
||||||
|
|
||||||
|
|
||||||
def configure_logging(debug=False):
|
def configure_logging(debug=False):
|
||||||
warnings.simplefilter('ignore', category=ResourceWarning)
|
warnings.simplefilter('ignore', category=ResourceWarning)
|
||||||
warnings.simplefilter('ignore', category=PytzUsageWarning)
|
warnings.simplefilter('ignore', category=PytzUsageWarning)
|
||||||
|
@ -129,6 +159,7 @@ def configure_logging(debug=False):
|
||||||
logging.getLogger("ga4mp.ga4mp").setLevel(logging.ERROR)
|
logging.getLogger("ga4mp.ga4mp").setLevel(logging.ERROR)
|
||||||
|
|
||||||
logging.getLogger("waitress").setLevel(logging.ERROR)
|
logging.getLogger("waitress").setLevel(logging.ERROR)
|
||||||
|
logging.getLogger("waitress").addFilter(UnwantedWaitressMessageFilter())
|
||||||
logging.getLogger("knowit").setLevel(logging.CRITICAL)
|
logging.getLogger("knowit").setLevel(logging.CRITICAL)
|
||||||
logging.getLogger("enzyme").setLevel(logging.CRITICAL)
|
logging.getLogger("enzyme").setLevel(logging.CRITICAL)
|
||||||
logging.getLogger("guessit").setLevel(logging.WARNING)
|
logging.getLogger("guessit").setLevel(logging.WARNING)
|
||||||
|
|
Loading…
Reference in a new issue