def METHOD_NAME(self, record):  # noqa
    # Handle known StreamClosedError from Tornado
    # These occur when we forcibly close Websockets or
    # browser connections during the test.
    # https://github.com/tornadoweb/tornado/issues/2834
    if (
        hasattr(record, "exc_info")
        and record.exc_info is not None
        and isinstance(record.exc_info[1], (StreamClosedError, WebSocketClosedError))
    ):
        return
    return super().METHOD_NAME(record)