Skip to content

Commit

Permalink
Merge pull request #136 from dhis2/fix_logs
Browse files Browse the repository at this point in the history
fix: Use slf4j logger
  • Loading branch information
enricocolasante authored Jun 20, 2024
2 parents cb47f8c + f6ca0c6 commit 305936d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ kotlin {
implementation(kotlin("test"))
}
}
val jvmMain by getting
val jvmMain by getting {
dependencies {
implementation("org.slf4j:slf4j-api:1.7.36")
}
}
val jvmTest by getting
val jsMain by getting {
dependencies {
Expand Down
4 changes: 2 additions & 2 deletions src/jvmMain/kotlin/org/hisp/dhis/rules/Logger.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.hisp.dhis.rules

actual fun createLogger(className: String): Logger{
val javaLogger = java.util.logging.Logger.getLogger(className)
return Logger({message -> javaLogger.severe(message)}, {message: String -> javaLogger.fine(message)})
val javaLogger = org.slf4j.LoggerFactory.getLogger(className)
return Logger({message -> javaLogger.error(message)}, {message: String -> javaLogger.debug(message)})
}

0 comments on commit 305936d

Please sign in to comment.