From 7e42b35b6237719ae0b92b882a0370229fbf6e96 Mon Sep 17 00:00:00 2001 From: Jeff Schroeder Date: Wed, 16 Sep 2015 22:57:22 -0500 Subject: [PATCH 1/2] Set logging of SQL queries to sqlite as debug log messages --- homeassistant/components/recorder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/recorder.py b/homeassistant/components/recorder.py index 73487163425..10f6576d23f 100644 --- a/homeassistant/components/recorder.py +++ b/homeassistant/components/recorder.py @@ -256,7 +256,7 @@ class Recorder(threading.Thread): """ Query the database. """ try: with self.conn, self.lock: - _LOGGER.info("Running query %s", sql_query) + _LOGGER.debug("Running query %s", sql_query) cur = self.conn.cursor() From 550f31d4c33edebc84ef6f28c96da81c4e8cd11d Mon Sep 17 00:00:00 2001 From: Jeff Schroeder Date: Wed, 16 Sep 2015 22:54:43 -0500 Subject: [PATCH 2/2] Quiet down some of the logging in the sonos platform This is due to the soco library logging very excessively and it using requests to connect to each Sonos speaker every 10 seconds (by default). This makes the logs much more pleasant to use for finding real issues. --- homeassistant/components/media_player/sonos.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/homeassistant/components/media_player/sonos.py b/homeassistant/components/media_player/sonos.py index fd9e31e1810..faf4f6aa983 100644 --- a/homeassistant/components/media_player/sonos.py +++ b/homeassistant/components/media_player/sonos.py @@ -28,6 +28,14 @@ REQUIREMENTS = ['SoCo==0.11.1'] _LOGGER = logging.getLogger(__name__) +# The soco library is excessively chatty when it comes to logging and +# causes a LOT of spam in the logs due to making a http connection to each +# speaker every 10 seconds. Quiet it down a bit to just actual problems. +_SOCO_LOGGER = logging.getLogger('soco') +_SOCO_LOGGER.setLevel(logging.ERROR) +_REQUESTS_LOGGER = logging.getLogger('requests') +_REQUESTS_LOGGER.setLevel(logging.ERROR) + SUPPORT_SONOS = SUPPORT_PAUSE | SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE |\ SUPPORT_PREVIOUS_TRACK | SUPPORT_NEXT_TRACK | SUPPORT_SEEK