Skip to content

Commit

Permalink
Revert "Attempt: silent slf4j nagging"
Browse files Browse the repository at this point in the history
This reverts commit 80f0995.
  • Loading branch information
cstamas committed Feb 6, 2025
1 parent 80f0995 commit 78b1ba8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
10 changes: 5 additions & 5 deletions impl/maven-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ under the License.
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>ch.qos.logback</groupId>-->
<!-- <artifactId>logback-classic</artifactId>-->
<!-- <optional>true</optional>-->
<!-- </dependency>-->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
package org.apache.maven.cling.logging.impl;

import org.apache.maven.cling.logging.BaseSlf4jConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Configuration for slf4j-logback.
Expand All @@ -28,13 +30,13 @@
public class LogbackConfiguration extends BaseSlf4jConfiguration {
@Override
public void setRootLoggerLevel(Level level) {
// ch.qos.logback.classic.Level value =
// switch (level) {
// case DEBUG -> ch.qos.logback.classic.Level.DEBUG;
// case INFO -> ch.qos.logback.classic.Level.INFO;
// default -> ch.qos.logback.classic.Level.ERROR;
// };
// ((ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME)).setLevel(value);
ch.qos.logback.classic.Level value =
switch (level) {
case DEBUG -> ch.qos.logback.classic.Level.DEBUG;
case INFO -> ch.qos.logback.classic.Level.INFO;
default -> ch.qos.logback.classic.Level.ERROR;
};
((ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME)).setLevel(value);
}

@Override
Expand Down

0 comments on commit 78b1ba8

Please sign in to comment.