You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ad...@apache.org on 2019/08/01 19:04:19 UTC
[maven-pmd-plugin] 02/02: [MPMD-292] - PMD Log is not always
integrated into maven log
This is an automated email from the ASF dual-hosted git repository.
adangel pushed a commit to branch it-mpmd-187
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git
commit a3a8f9b81e8a31efd9f7b05348386c544838c864
Author: Andreas Dangel <ad...@apache.org>
AuthorDate: Thu Aug 1 20:31:00 2019 +0200
[MPMD-292] - PMD Log is not always integrated into maven log
---
.../java/org/apache/maven/plugins/pmd/AbstractPmdReport.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java b/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java
index 53a6da2..4cadbcd 100644
--- a/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java
+++ b/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java
@@ -232,6 +232,13 @@ public abstract class AbstractPmdReport
@Parameter( defaultValue = "true", property = "pmd.showPmdLog" )
protected boolean showPmdLog = true;
+ /**
+ * This holds a strong reference in case we configured the logger to
+ * redirect to slf4j. See {@link #showPmdLog}. Without a strong reference,
+ * the logger might be garbage collected and the redirect to slf4j is gone.
+ */
+ private Logger julLogger;
+
/** The files that are being analyzed. */
protected Map<File, PmdFileInfo> filesToProcess;
@@ -576,7 +583,8 @@ public abstract class AbstractPmdReport
logger.addHandler( handler );
handler.setLevel( Level.ALL );
logger.setLevel( Level.ALL );
- getLog().debug( "Configured jul-to-slf4j bridge for " + logger.getName() );
+ julLogger = logger;
+ julLogger.fine( "Configured jul-to-slf4j bridge for " + logger.getName() );
}
static String getPmdVersion()