gnodet commented on code in PR #2042:
URL: https://github.com/apache/maven/pull/2042#discussion_r1916024056
##########
impl/maven-cli/src/main/java/org/apache/maven/cling/logging/impl/MavenSimpleConfiguration.java:
##########
@@ -37,7 +40,16 @@ public void setRootLoggerLevel(Level level) {
case INFO -> "info";
default -> "error";
};
- System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", value);
+
+ String defaultLogLevelKey = "org.slf4j.simpleLogger.defaultLogLevel";
+ String current = System.getProperty(defaultLogLevelKey);
+ if (current == null) {
+ System.setProperty(defaultLogLevelKey, value);
+ } else {
Review Comment:
```
➜ maven git:(feat/MNG-8512) ✗
~/work/git/maven/apache-maven/target/apache-maven-4.0.0-rc-3-SNAPSHOT/bin/mvn
-X -Dorg.slf4j.simpleLogger.defaultLogLevel=debug
[WARNING] System property 'org.slf4j.simpleLogger.defaultLogLevel' is
already set to 'debug' - ignoring log level from -X/-e/-q options
Apache Maven 4.0.0-rc-3-SNAPSHOT (cc9dc285f04d254e786b9e727ebea1d368bca400)
...
```
I think what @elharo means is that we don't want to print a warning if we're
using `-X` and the system property is already set to the correct value.
--
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]