Improve logging of console log parsing.
@@ -172,6 +172,12 @@ public abstract class ReportScanningTool extends Tool {
Report report = createParser().parse(new ConsoleLogReaderFactory(run));
+ report.logInfo("Successfully parsed console log");
+ report.logInfo("-> found %s (skipped %s)",
+ plural(report.getSize(), "issue"),
+ plural(report.getDuplicatesSize(), "duplicate"));
+
+
if (getDescriptor().isConsoleLog()) {
report.stream().filter(issue -> !issue.hasFileName())
.forEach(issue -> issue.setFileName(ConsoleLogHandler.JENKINS_CONSOLE_LOG_FILE_NAME_ID));
@@ -184,6 +190,17 @@ public abstract class ReportScanningTool extends Tool {
return consoleReport;
}
+ @SuppressWarnings("PMD.AvoidLiteralsInIfCondition")
+ private String plural(final int count, final String itemName) {
+ StringBuilder builder = new StringBuilder(itemName);
+ if (count != 1) {
+ builder.append('s');
+ }
+ builder.insert(0, ' ');
+ builder.insert(0, count);
+ return builder.toString();
+ }
+
private void waitForConsoleToFlush(final LogHandler logger) {
try {
logger.log("Sleeping for 5 seconds due to JENKINS-32191...");
