File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 11import re
2+ import logging
3+
4+
5+ class Log :
6+ __logger = logging .getLogger (__name__ )
7+
8+ @classmethod
9+ def warn (cls , message : str ):
10+ Log .__logger .warning (message )
211
312
413class AnalyzerHelpers :
Original file line number Diff line number Diff line change 11from ._helpers import AnalyzerHelpers
2+ from ._helpers import Log
23from functional import seq
3- from warnings import warn
44
55
66class Metrics :
@@ -32,7 +32,7 @@ def instability(framework, frameworks):
3232 fan_out = Metrics .fan_out (framework )
3333 sum_in_out = fan_in + fan_out
3434 if sum_in_out == 0 :
35- warn (f'{ framework .name } is not linked with the rest of the project.' , Warning )
35+ Log . warn (f'{ framework .name } is not linked with the rest of the project.' )
3636 return 0
3737 return fan_out / sum_in_out
3838
@@ -46,7 +46,7 @@ def abstractness(framework):
4646 :return: The abstractness value (double)
4747 """
4848 if framework .number_of_concrete_data_structures == 0 :
49- warn (f'{ framework .name } is an external dependency.' , Warning )
49+ Log . warn (f'{ framework .name } is an external dependency.' )
5050 return 0
5151 else :
5252 return framework .number_of_interfaces / framework .number_of_concrete_data_structures
You can’t perform that action at this time.
0 commit comments