gnodet-bot commented on code in PR #14177:
URL: https://github.com/apache/maven/pull/14177#discussion_r4732192345


##########
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java:
##########
@@ -785,9 +785,9 @@ protected Runnable settings(C context, boolean 
emitSettingsWarnings, SettingsBui
             context.eventSpyDispatcher.onEvent(settingsRequest);
         }
 
-        context.logger.debug("Reading installation settings from '" + 
installationSettingsFile + "'");
-        context.logger.debug("Reading project settings from '" + 
projectSettingsFile + "'");
-        context.logger.debug("Reading user settings from '" + userSettingsFile 
+ "'");
+        context.logger.atDebug().log("Reading installation settings from 
'{0}'", installationSettingsFile);
+        context.logger.atDebug().log("Reading project settings from '{0}'", 
projectSettingsFile);
+        context.logger.atDebug().log("Reading user settings from '{0}'", 
userSettingsFile);

Review Comment:
   ⚠️ **Still unaddressed — compilation error: wrong logger type and wrong 
placeholder syntax.**
   
   `context.logger` is `org.apache.maven.api.cli.Logger`, Maven's own 
early-bootstrap logging interface. It has no `atDebug()` method — that is a 
SLF4J 2.x fluent API extension that this interface does not implement. This 
will not compile.
   
   Additionally, `{0}` is `java.text.MessageFormat` syntax (JUL/j.u.l), not 
SLF4J's `{}` format — the placeholders would not be substituted at runtime even 
if the method existed.
   
   The correct fix is to keep the original `context.logger.debug(String)` call, 
using `{}` placeholders via `String.formatted()` if eager allocation is a 
concern, or simply keeping the string concatenation (this is a debug-level 
early-bootstrap path, rarely executed in production):
   
   ```suggestion
           context.logger.debug("Reading installation settings from '" + 
installationSettingsFile + "'");
           context.logger.debug("Reading project settings from '" + 
projectSettingsFile + "'");
           context.logger.debug("Reading user settings from '" + 
userSettingsFile + "'");
   ```



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