diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-12-26 15:23:28 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-12-26 15:45:46 -0500 |
commit | 14279cf9d637fe7b0fa0984dc5be854f9a2303a3 (patch) | |
tree | edaa63dc38e5108e53c9e3a1416cd50732192bd8 | |
parent | b6260fa49716f347668598a9a78fe39ab44ca6cf (diff) | |
download | python-setuptools-git-feature/logging.tar.gz |
Monkey patch distutils.log.set_threshold so the Python logger honors calls to it.feature/logging
-rw-r--r-- | setuptools/logging.py | 8 |
1 files changed, 8 insertions, 0 deletions
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) |