'Specify string format arguments as logging function parameters'
Used when a logging statement has a call form of “logging.<logging method>(format_string % (format_args…))”. Such calls should leave string interpolation to the logging method itself and be written “logging.<logging method>(format_string, format_args…)” so that the program may avoid incurring the cost of the interpolation in those cases in which no message will be logged. For more, see http://www.python.org/dev/peps/pep-0282/.
import logging a = 1 b = 2 logging.debug("State: %d, %d" % (a, b))
4:0: W1201: Use lazy % formatting in logging functions
Here is how you should use it:
import logging a = 1 b = 2 logging.debug("State: %d, %d", a, b)
No issues found.