You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2021/01/26 11:45:05 UTC

[GitHub] [maven] rmannibucau commented on a change in pull request #438: [MNG-7083] - introduce lazy Log message evaluation

rmannibucau commented on a change in pull request #438:
URL: https://github.com/apache/maven/pull/438#discussion_r564449085



##########
File path: maven-plugin-api/pom.xml
##########
@@ -54,6 +54,11 @@ under the License.
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-classworlds</artifactId>
     </dependency>
+    <dependency>

Review comment:
       can we not use it and just test with a custom Log impl (like an in memory one or reusing default/logger one)? I don't see what it brings but I see how the test can pass with a broken impl ;)

##########
File path: maven-plugin-api/src/main/java/org/apache/maven/plugin/logging/Log.java
##########
@@ -63,6 +65,20 @@
      */
     void debug( Throwable error );
 
+    /**
+     * Send a message to the user in the <b>debug</b> error level by computing the message
+     * only when needed. The supplier will be called only if @see #isDebugEnabled() is <b>true</b>.
+     * 
+     * @param messageSupplier a non null Supplier of the message to use
+     */
+    default void debug( Supplier<String> messageSupplier )

Review comment:
       don't think we need any default, I would add an AbstractLog our two impl would inherit from and that's it, will avoid the common default pitfalls - or corrollar is all our impl should impl it without using the default impl, up to you.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org