desruisseaux commented on code in PR #1027:
URL: 
https://github.com/apache/maven-compiler-plugin/pull/1027#discussion_r2753718206


##########
src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java:
##########
@@ -885,6 +885,16 @@ final void 
amendincrementalCompilation(EnumSet<IncrementalBuild.Aspect> aspects,
     @Parameter(property = "maven.compiler.maxmem")
     protected String maxmem;
 
+    /**
+     * Should maven log a summary of compiler messages (if any) by type.
+     * When there are a lot of messages of the same type (unchecked, 
deprecation etc),
+     * it can make the output more readable.
+     *
+     * @since 4.0.0-beta-5
+     */
+    @Parameter(property = "maven.compiler.messageLogType", defaultValue = 
"COMPILER")
+    protected MessageLogType messageLogType;
+

Review Comment:
   Could we use logger configuration instead of introducing a new plugin 
parameter? Currently, we use dependency injection like below, where `Log` is 
`org.apache.maven.api.plugin.Log`:
   
   ```java
   @Inject
   protected Log logger;
   ```
   
   I think that each plugin should use a named logger. With 
https://github.com/apache/maven/pull/11685 recently merged, I would check if 
using `System.getLogger("org.apache.maven.compiler")` produces the desired 
output. If it works, then I suggest to drop `org.apache.maven.api.plugin.Log` 
and use system loggers or `java.util.logging` instead. Then:
   
   * "org.apache.maven" would be the parent logger in Maven core and all 
plugins.
   * "org.apache.maven.compiler" would be the logger for Maven Compiler Plugin.
   * "org.apache.maven.compiler.summary" (or something else, proposal welcome) 
could be the logger for summary.
   
   Logging can be configured in a logging framework specific way, but we could 
also add a `<logging>` section in the POM 4.1 model. We need to address Maven 
logging verbosity anyway, not just for the compiler plugin.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to