Suppress accept_connection2 asyncio log spew

This commit is contained in:
Neil Booth 2018-08-08 12:48:22 +09:00
parent 931b227618
commit 12c49bbe75

View File

@ -29,6 +29,7 @@ class ServerBase(object):
'''
SUPPRESS_MESSAGE_REGEX = re.compile('SSH handshake')
SUPPRESS_TASK_REGEX = re.compile('accept_connection2')
PYTHON_MIN_VERSION = (3, 6)
def __init__(self, env):
@ -68,6 +69,8 @@ class ServerBase(object):
message = context.get('message')
if message and self.SUPPRESS_MESSAGE_REGEX.match(message):
return
if self.SUPPRESS_TASK_REGEX.match(repr(context.get('task'))):
return
loop.default_exception_handler(context)
async def _main(self, loop):