File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 5
5
"""
6
6
7
7
import logging
8
+ import warnings
8
9
9
10
from ._log import log as _global_log
10
11
@@ -36,3 +37,21 @@ def set_verbosity(v):
36
37
set_threshold (logging .INFO )
37
38
elif v >= 2 :
38
39
set_threshold (logging .DEBUG )
40
+
41
+
42
+ class Log (logging .Logger ):
43
+ """distutils.log.Log is deprecated, please use an alternative from `logging`."""
44
+
45
+ def __init__ (self , threshold = WARN ):
46
+ warnings .warn (Log .__doc__ ) # avoid DeprecationWarning to ensure warn is shown
47
+ super ().__init__ (__name__ , level = threshold )
48
+
49
+ @property
50
+ def threshold (self ):
51
+ return self .level
52
+
53
+ @threshold .setter
54
+ def threshold (self , level ):
55
+ self .setLevel (level )
56
+
57
+ warn = logging .Logger .warning
Original file line number Diff line number Diff line change @@ -24,3 +24,6 @@ filterwarnings=
24
24
25
25
# suppress warnings in deprecated compilers
26
26
ignore:(bcpp|msvc9?)compiler is deprecated
27
+
28
+ # suppress well know deprecation warning
29
+ ignore:distutils.log.Log is deprecated
You can’t perform that action at this time.
0 commit comments