I am using what felt like correct Java code in order to trace sections of a program:
LOG.debug("a simple string with no formatters nor placeholders.");
However, SonarLint in Eclipse is showing the following report on that line:
String contains no format specifiers.
The matching rule, S3457, reads "Printf-style format strings should be used correctly (squid:S3457)".
I am using logback and the LOG
variable in the code above is of type org.slf4j.Logger
.
I'd like to clear this report, and in the meantime, learn something.
Can someone enlighten me as to what is wrong in this? Or is it a case of Sonar being too strict in applying that rule?
Otherwise, is it considered bad practice to output a log message without outputting values?