diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2022-11-22 18:59:57 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2022-11-22 18:59:57 -0500 |
| commit | 4947109bf188727bfd8a6dc4770f567bfd613dcd (patch) | |
| tree | e6f9cead8e5bc6864be59d4625c7423a08c14839 /setuptools/_distutils | |
| parent | b9dfcb8fc911186c70688333187186a402645153 (diff) | |
| parent | 3e9d47e0f631a92cc0251ac212a14cad9570f76b (diff) | |
| download | python-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.py | 19 |
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 |
