Silence sisyphus chatty logging from dependencies (#66711)

This commit is contained in:
Jonathan Keljo 2022-02-18 10:03:03 -08:00 committed by GitHub
parent 2d2101528c
commit 011c645ee2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,19 +29,15 @@ CONFIG_SCHEMA = vol.Schema(
{DOMAIN: vol.Any(AUTODETECT_SCHEMA, TABLES_SCHEMA)}, extra=vol.ALLOW_EXTRA
)
# Silence these loggers by default. Their INFO level is super chatty and we
# only need error-level logging from the integration itself by default.
logging.getLogger("socketio.client").setLevel(logging.CRITICAL + 1)
logging.getLogger("engineio.client").setLevel(logging.CRITICAL + 1)
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the sisyphus component."""
class SocketIONoiseFilter(logging.Filter):
"""Filters out excessively verbose logs from SocketIO."""
def filter(self, record):
if "waiting for connection" in record.msg:
return False
return True
logging.getLogger("socketIO-client").addFilter(SocketIONoiseFilter())
tables = hass.data.setdefault(DATA_SISYPHUS, {})
table_configs = config[DOMAIN]
session = async_get_clientsession(hass)