Affects PMD Version: 6.21.0
Rule: InvalidLogMessageFormat
Description:
InvalidLogMessageFormat interprets the marker as the log message and can't determine the correct number of arguments.
Before #2196 those log messages were probably just ignored...
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.Marker; import org.slf4j.helpers.BasicMarkerFactory; public class InvalidLogMessageFormatTest { private static final Logger logger = LoggerFactory.getLogger("MyLogger"); private static final Marker marker = BasicMarkerFactory.getMarker("MARKER"); public static void main(String[] args) { logger.warn(marker, "foo {}", "bar"); // gets flagged } }
Running PMD through: Other
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4