--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Logging/translations.py Thu Nov 30 16:39:46 2023 +0100 @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2023 Detlev Offenbach <detlev@die-offenbachs.de> +# + + +""" +Module implementing message translations for the code style plugin messages +(logging part). +""" + +from PyQt6.QtCore import QCoreApplication + +_loggingMessages = { + ## Logging format + "L101": QCoreApplication.translate( + "LoggingChecker", + "logging statement uses string.format()", + ), + "L102": QCoreApplication.translate( + "LoggingChecker", + "logging statement uses '%'", # __IGNORE_WARNING_M601__ + ), + "L103": QCoreApplication.translate( + "LoggingChecker", + "logging statement uses '+'", + ), + "L104": QCoreApplication.translate( + "LoggingChecker", + "logging statement uses f-string", + ), + "L110": QCoreApplication.translate( + "LoggingChecker", + "logging statement uses 'warn' instead of 'warning'", + ), + "L121": QCoreApplication.translate( + "LoggingChecker", + "logging statement uses an extra field that clashes with a LogRecord field: {0}" + ), + "L130": QCoreApplication.translate( + "LoggingChecker", + "logging statement uses exception in arguments" + ), + "L131": QCoreApplication.translate( + "LoggingChecker", + "logging: .exception(...) should be used instead of .error(..., exc_info=True)" + ), + "L132": QCoreApplication.translate( + "LoggingChecker", + "logging statement has redundant exc_info" + ), +} + +_loggingMessagesSampleArgs = { + "L121": ["pathname"] +}