mirror of
https://github.com/apache/lucene.git
synced 2025-02-24 03:05:06 +00:00
SOLR-14523: Enhance gradle logging calls validation: eliminate getMessage(). Added Gradle validation check.
This commit is contained in:
parent
c3d6a8bf7a
commit
743234ed83
@ -134,7 +134,10 @@ class ValidateLogCallsTask extends DefaultTask {
|
||||
violation = true
|
||||
}
|
||||
}
|
||||
|
||||
if (stripped.contains("getMessage()") || stripped.contains("getCause()")) {
|
||||
cause = "getMessage or getCause in log line";
|
||||
violation = true;
|
||||
}
|
||||
if (violation) {
|
||||
reportViolation(String.format("cause: '%s' Suspicious logging call, Parameterize and possibly surround with 'if (log.is*Enabled) {..}'. Help at: 'gradlew helpValidateLogCalls' %s %s:%d"
|
||||
, cause , System.lineSeparator, file.getAbsolutePath(), lineNumber))
|
||||
|
Loading…
x
Reference in New Issue
Block a user