Correct lint issues : "Use lazy % formatting in logging functions"
Summary
PyLint return multiple occurence of the error Use lazy % formatting in logging functions
.
Steps to reproduce
- Write not lazy log strings like
logger.debug(f"this is a log : {my_value()})
- Run PyLint
What is the current bug behavior?
The my_value()
is always evaluated even if the log is not printed to the user.
Also PyLint return an error.
What is the expected correct behavior?
The my_value()
should be evaluated only if the log is printed to the user.
Possible fixes
Write lazy log strings like logger.debug("this is a log : %s", my_value)