From 011c645ee27a3c9528554577bbb6b797ca9c3d52 Mon Sep 17 00:00:00 2001 From: Jonathan Keljo Date: Fri, 18 Feb 2022 10:03:03 -0800 Subject: [PATCH] Silence sisyphus chatty logging from dependencies (#66711) --- homeassistant/components/sisyphus/__init__.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/sisyphus/__init__.py b/homeassistant/components/sisyphus/__init__.py index cda8f0da1f2..721c51ca964 100644 --- a/homeassistant/components/sisyphus/__init__.py +++ b/homeassistant/components/sisyphus/__init__.py @@ -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)