From 7cd46f6842cc0e0c8279b1f1607d9ffb4acb9102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haoran=20S=2E=20Diao=20=28=E5=88=81=E6=B5=A9=E7=84=B6=29?= <0@hairydiode.xyz> Date: Wed, 5 Jul 2023 04:53:17 -0700 Subject: initial commit, includes venv --- .../python3.11/site-packages/setuptools/logging.py | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 e/lib/python3.11/site-packages/setuptools/logging.py (limited to 'e/lib/python3.11/site-packages/setuptools/logging.py') diff --git a/e/lib/python3.11/site-packages/setuptools/logging.py b/e/lib/python3.11/site-packages/setuptools/logging.py new file mode 100644 index 0000000..e99c1b9 --- /dev/null +++ b/e/lib/python3.11/site-packages/setuptools/logging.py @@ -0,0 +1,36 @@ +import sys +import logging +import distutils.log +from . import monkey + + +def _not_warning(record): + return record.levelno < logging.WARNING + + +def configure(): + """ + Configure logging to emit warning and above to stderr + and everything else to stdout. This behavior is provided + for compatibility with distutils.log but may change in + the future. + """ + err_handler = logging.StreamHandler() + err_handler.setLevel(logging.WARNING) + out_handler = logging.StreamHandler(sys.stdout) + out_handler.addFilter(_not_warning) + handlers = err_handler, out_handler + logging.basicConfig( + format="{message}", style='{', handlers=handlers, level=logging.DEBUG) + if hasattr(distutils.log, 'Log'): + monkey.patch_func(set_threshold, distutils.log, 'set_threshold') + # For some reason `distutils.log` module is getting cached in `distutils.dist` + # and then loaded again when patched, + # implying: id(distutils.log) != id(distutils.dist.log). + # Make sure the same module object is used everywhere: + distutils.dist.log = distutils.log + + +def set_threshold(level): + logging.root.setLevel(level*10) + return set_threshold.unpatched(level) -- cgit v1.1