Skip to content

Commit

Permalink
Remove logback
Browse files Browse the repository at this point in the history
  • Loading branch information
ebocher committed Feb 2, 2024
1 parent ef2a406 commit f4fa4ff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
6 changes: 3 additions & 3 deletions common-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback-version}</version>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j-version}</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.orbisgis.geoclimate.utils

import ch.qos.logback.classic.Level
import ch.qos.logback.classic.LoggerContext
import org.slf4j.Logger
import org.slf4j.LoggerFactory

Expand Down Expand Up @@ -77,20 +75,17 @@ class LoggerUtils {
*/
static void setLoggerLevel(String loggerLevel) {
if (loggerLevel) {
Level level
if (loggerLevel.equalsIgnoreCase("INFO")) {
level = Level.INFO
System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", loggerLevel.toLowerCase())
} else if (loggerLevel.equalsIgnoreCase("DEBUG")) {
level = Level.DEBUG
System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", loggerLevel.toLowerCase())
} else if (loggerLevel.equalsIgnoreCase("TRACE")) {
level = Level.TRACE
System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", loggerLevel.toLowerCase())
} else if (loggerLevel.equalsIgnoreCase("OFF")) {
level = Level.OFF
System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", loggerLevel.toLowerCase())
} else {
throw new RuntimeException("Invalid log level. Allowed values are : INFO, DEBUG, TRACE, OFF")
}
var context = (LoggerContext) LoggerFactory.getILoggerFactory()
context.getLoggerList().each { it -> it.setLevel(level) }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ package org.orbisgis.geoclimate.osmtools
import org.orbisgis.geoclimate.osmtools.utils.TransformUtils
import org.orbisgis.geoclimate.osmtools.utils.Utilities
import org.orbisgis.geoclimate.utils.AbstractScript
import org.slf4j.Logger
import org.slf4j.LoggerFactory

/**
* Main script to access to all processes used to extract, transform and save OSM data as GIS layers.
Expand Down

0 comments on commit f4fa4ff

Please sign in to comment.