gnodet commented on code in PR #12694:
URL: https://github.com/apache/maven/pull/12694#discussion_r4012554468


##########
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java:
##########
@@ -332,6 +332,16 @@ protected final void createTerminal(C context) {
             ProjectBuildLogAppender projectBuildLogAppender =
                     new 
ProjectBuildLogAppender(determineBuildEventListener(context));
             context.closeables.add(projectBuildLogAppender);
+
+            // Now that the logSink (and any -l log-file writer) is installed,
+            // replay early log messages that were accumulated before
+            // activateLogging() ran.  This ensures messages such as
+            // "Enabled to break the build on log level WARN." reach the log
+            // file rather than stdout (MavenITmng6065 regression fix).
+            if (context.pendingEarlyLogs != null) {
+                context.pendingEarlyLogs.forEach(e -> 
context.logger.log(e.level(), e.message(), e.error()));
+                context.pendingEarlyLogs = null;

Review Comment:
   Fixed in 63ed04e. Moved the drain into `activateLogging()` (after the 
`context.logger.drain()` / logger swap), where `createTerminal()` has already 
installed `ProjectBuildLogAppender`. The dead drain block in `createTerminal()` 
has been removed, and the `pendingEarlyLogs` field in `LookupContext` is gone 
too.



##########
api/maven-api-core/src/main/java/org/apache/maven/api/plugin/Log.java:
##########
@@ -87,8 +87,6 @@ default void trace(Throwable error) {}
      * The supplier is only evaluated if trace is enabled.
      * <p>
      * The default implementation is a no-op for backward compatibility.
-     *
-     * @param content the message supplier
      */
     default void trace(Supplier<String> content) {}

Review Comment:
   Fixed in 63ed04e. Added `@param content the message supplier` to the Javadoc 
for `trace(Supplier<String>)`.



##########
api/maven-api-core/src/main/java/org/apache/maven/api/plugin/Log.java:
##########
@@ -97,9 +95,6 @@ default void trace(Supplier<String> content) {}
      * The supplier is only evaluated if trace is enabled.
      * <p>
      * The default implementation is a no-op for backward compatibility.
-     *
-     * @param content the message supplier
-     * @param error the error that caused this log
      */
     default void trace(Supplier<String> content, Throwable error) {}

Review Comment:
   Fixed in 63ed04e. Added both `@param content the message supplier` and 
`@param error the error that caused this log` to the Javadoc for 
`trace(Supplier<String>, Throwable)`.



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