src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Logging/LoggingVisitor.py

branch
eric7
changeset 10754
6faecb62f3a4
parent 10640
7806ae725731
child 11090
f5f5f5803935
diff -r 031cfa81992a -r 6faecb62f3a4 src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Logging/LoggingVisitor.py
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Logging/LoggingVisitor.py	Sat Jun 08 15:01:47 2024 +0200
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Logging/LoggingVisitor.py	Sat Jun 08 15:25:29 2024 +0200
@@ -226,6 +226,19 @@
             self.__error(node.lineno - 1, node.col_offset, "L101")
 
         if (
+            isinstance(node.func, ast.Attribute)
+            and node.func.attr in _LoggerMethods
+            and isinstance(node.func.value, ast.Name)
+            and self.__loggingName
+            and node.func.value.id == self.__loggingName
+        ) or (
+            isinstance(node.func, ast.Name)
+            and node.func.id in _LoggerMethods
+            and self.__fromImports.get(node.func.id) == "logging"
+        ):
+            self.__error(node.lineno - 1, node.col_offset, "L115")
+
+        if (
             self.__loggingName
             and isinstance(node.func, ast.Attribute)
             and node.func.attr == "getLogger"

eric ide

mercurial