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


##########
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:
   ⚠️ **Compilation error — wrong logger type and wrong placeholder syntax.**
   
   `context.logger` is `org.apache.maven.api.cli.Logger` (Maven's own 
early-bootstrap interface), **not** `org.slf4j.Logger`. The Maven `Logger` 
interface only defines `debug(String)` and `debug(String, Throwable)` — it has 
no `atDebug()` method.
   
   Additionally, `{0}` is JUL `MessageFormat` syntax. SLF4J uses `{}`.
   
   Revert to the original `debug(String)` calls:
   
   ```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