Squelch excessive logging

This commit is contained in:
Mark Qvist 2023-10-26 12:53:18 +02:00
parent cf6d88f17e
commit f531b2ecaa
4 changed files with 37 additions and 1 deletions

View file

@ -16,6 +16,7 @@ from kivy.logger import LOG_LEVELS, Logger
from mapview.constants import CACHE_DIR
import logging
# if "MAPVIEW_DEBUG_DOWNLOADER" in environ:
# Logger.setLevel(LOG_LEVELS['debug'])
# Logger.setLevel(LOG_LEVELS['error'])
@ -52,6 +53,18 @@ class Downloader:
if not exists(self.cache_dir):
makedirs(self.cache_dir)
logging.getLogger("urllib3").setLevel(logging.WARNING)
logging.getLogger("urllib3.response").setLevel(logging.WARNING)
logging.getLogger("urllib3.connection").setLevel(logging.WARNING)
logging.getLogger("urllib3.connectionpool").setLevel(logging.WARNING)
logging.getLogger("requests").setLevel(logging.WARNING)
logging.getLogger("urllib3").propagate = True
logging.getLogger("requests").propagate = True
logging.getLogger("urllib3.response").propagate = True
logging.getLogger("urllib3.connection").propagate = True
logging.getLogger("urllib3.connectionpool").propagate = True
def submit(self, f, *args, **kwargs):
future = self.executor.submit(f, *args, **kwargs)
self._futures.append(future)