summaryrefslogtreecommitdiff
path: root/setuptools/_distutils
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-11-22 18:59:57 -0500
committerJason R. Coombs <jaraco@jaraco.com>2022-11-22 18:59:57 -0500
commit4947109bf188727bfd8a6dc4770f567bfd613dcd (patch)
treee6f9cead8e5bc6864be59d4625c7423a08c14839 /setuptools/_distutils
parentb9dfcb8fc911186c70688333187186a402645153 (diff)
parent3e9d47e0f631a92cc0251ac212a14cad9570f76b (diff)
downloadpython-setuptools-git-4947109bf188727bfd8a6dc4770f567bfd613dcd.tar.gz
Merge https://github.com/pypa/distutils into bugfix/3693-distutils-3e9d47e
Diffstat (limited to 'setuptools/_distutils')
-rw-r--r--setuptools/_distutils/log.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/setuptools/_distutils/log.py b/setuptools/_distutils/log.py
index bb789c30..239f3158 100644
--- a/setuptools/_distutils/log.py
+++ b/setuptools/_distutils/log.py
@@ -5,6 +5,7 @@ Retained for compatibility and should not be used.
"""
import logging
+import warnings
from ._log import log as _global_log
@@ -36,3 +37,21 @@ def set_verbosity(v):
set_threshold(logging.INFO)
elif v >= 2:
set_threshold(logging.DEBUG)
+
+
+class Log(logging.Logger):
+ """distutils.log.Log is deprecated, please use an alternative from `logging`."""
+
+ def __init__(self, threshold=WARN):
+ warnings.warn(Log.__doc__) # avoid DeprecationWarning to ensure warn is shown
+ super().__init__(__name__, level=threshold)
+
+ @property
+ def threshold(self):
+ return self.level
+
+ @threshold.setter
+ def threshold(self, level):
+ self.setLevel(level)
+
+ warn = logging.Logger.warning