-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log severity for all audit events, not just warnings #67
Comments
Patch (based on 5.3) that unfortunately breaks many unit tests: diff -r 1b7a252d5e1e src/checkstyle/com/puppycrawl/tools/checkstyle/DefaultLogger.java
--- a/src/checkstyle/com/puppycrawl/tools/checkstyle/DefaultLogger.java Tue Oct 19 18:56:17 2010 +1000
+++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/DefaultLogger.java Wed Feb 22 11:38:12 2012 +1100
@@ -109,9 +109,7 @@
if (aEvt.getColumn() > 0) {
sb.append(':').append(aEvt.getColumn());
}
- if (SeverityLevel.WARNING.equals(severityLevel)) {
- sb.append(": warning");
- }
+ sb.append(": ").append(severityLevel.getName());
sb.append(": ").append(message);
mErrorWriter.println(sb.toString());
} |
valid point, patch is correct on 5.7-Snapshot, but ... DefaultLogger is used in UTs, so it have to be updated to have property that will manage printing of Severity - "boolean printSeverity", by default for UTs it will be disabled to satisfy all existing UTs. In class that option will be "true" by default.
for himself with printing severity level. @richarddbarnett, if you need this fix .... please follow instructions above in other case wait . |
If I understood everything correct.. In all places except for UTs this option is used with its default value (true), so new option was added to DefaultLogger's ctors and all calls of these ctors are updated with true value, except for BaseCheckTestSupport. New createChecker() and verify() methods were introduced in BaseCheckTestSupport to support the setting of new option. |
fixed, will be in 6.5 |
compatibility problem should be resolved https://groups.google.com/forum/#!topic/checkstyle-devel/3jJ4cCQ3sM0 I revered as commit from master, now checkstyle-tester project (https://github.com/checkstyle/contribution/tree/master/checkstyle-tester) works fine |
Corresponding instantiation just have to be updated according to new params |
We can not wait for plugin to update that, maven plugin is still on very old version. |
@romani |
Not the best, i think that one mor c-tor will be better solution |
merged |
DefaultLogger.addError()
only logsAuditEvent.severityLevel
if it'sWARNING
.This makes it hard to find events of severity
ERROR
in egmvn checkstyle:check
output.Log
severityLevel
in all cases.The text was updated successfully, but these errors were encountered: