From daea93d9f9d5656d965cef8e5b0fad4bdf908e89 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 17 Oct 2016 15:14:10 -0400 Subject: [PATCH] Suppress requests/urllib3 connection pool log messages (#3854) requests/urllib3 is notorious for using the INFO log level for very DEBUG kinds of information. Given the configurability of python logging it's actually pretty easy to just set requests to WARN by default. This cleans out a bunch of largely unuseful log lines from home assistant output. --- homeassistant/bootstrap.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/homeassistant/bootstrap.py b/homeassistant/bootstrap.py index 4d4887a1a52..8ad4e16c8cd 100644 --- a/homeassistant/bootstrap.py +++ b/homeassistant/bootstrap.py @@ -355,6 +355,11 @@ def enable_logging(hass: core.HomeAssistant, verbose: bool=False, logging.basicConfig(level=logging.INFO) fmt = ("%(log_color)s%(asctime)s %(levelname)s (%(threadName)s) " "[%(name)s] %(message)s%(reset)s") + + # suppress overly verbose logs from libraries that aren't helpful + logging.getLogger("requests").setLevel(logging.WARNING) + logging.getLogger("urllib3").setLevel(logging.WARNING) + try: from colorlog import ColoredFormatter logging.getLogger().handlers[0].setFormatter(ColoredFormatter(