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.pull/3928/head
parent
1540bb1279
commit
daea93d9f9
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue