I use several modules in my project, however the modules output a lot of logs from the logger, which is annoying. Therefore, I will disable the logs:
boto_log = logging.getLogger("boto")
boto_log.setLevel(logging.CRITICAL)
es_log = logging.getLogger("elasticsearch")
es_log.setLevel(logging.CRITICAL)
urllib3_log = logging.getLogger("urllib3")
urllib3_log.setLevel(logging.CRITICAL)
Although this works, the code looks verbose. Is there a better, simpler way I can do this?
source
share