From 14279cf9d637fe7b0fa0984dc5be854f9a2303a3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 26 Dec 2021 15:23:28 -0500 Subject: Monkey patch distutils.log.set_threshold so the Python logger honors calls to it. --- setuptools/logging.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'setuptools/logging.py') diff --git a/setuptools/logging.py b/setuptools/logging.py index 0ac47059..dbead6e6 100644 --- a/setuptools/logging.py +++ b/setuptools/logging.py @@ -1,5 +1,7 @@ import sys import logging +import distutils.log +from . import monkey def _not_warning(record): @@ -20,3 +22,9 @@ def configure(): handlers = err_handler, out_handler logging.basicConfig( format="{message}", style='{', handlers=handlers, level=logging.DEBUG) + monkey.patch_func(set_threshold, distutils.log, 'set_threshold') + + +def set_threshold(level): + logging.root.setLevel(level*10) + return set_threshold.unpatched(level) -- cgit v1.2.1