Skip to content

Commit 896158c

Browse files
committed
Issue oshai#480 - remove clashed KotlinLogging extension
1 parent 122892f commit 896158c

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/javaMain/kotlin/io/github/oshai/kotlinlogging/slf4j/Slf4jExtensions.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.github.oshai.kotlinlogging.slf4j
22

33
import io.github.oshai.kotlinlogging.KLogger
4-
import io.github.oshai.kotlinlogging.KotlinLogging
54
import io.github.oshai.kotlinlogging.Level
65
import io.github.oshai.kotlinlogging.Marker
76
import io.github.oshai.kotlinlogging.slf4j.internal.Slf4jLoggerFactory
@@ -27,8 +26,4 @@ public fun Level.toSlf4j(): org.slf4j.event.Level =
2726
Level.OFF -> throw IllegalArgumentException("OFF level is not supported")
2827
}
2928

30-
@Suppress("UnusedReceiverParameter")
31-
public fun KotlinLogging.logger(underlyingLogger: Logger): KLogger =
32-
Slf4jLoggerFactory.wrapJLogger(underlyingLogger)
33-
34-
public fun Logger.toKLogger(): KLogger = KotlinLogging.logger(this)
29+
public fun Logger.toKLogger(): KLogger = Slf4jLoggerFactory.wrapJLogger(this)

src/jvmTest/kotlin/io/github/oshai/kotlinlogging/KotlinLoggingTest.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.github.oshai.kotlinlogging
22

3-
import io.github.oshai.kotlinlogging.slf4j.logger
43
import io.github.oshai.kotlinlogging.slf4j.toKLogger
54
import org.junit.jupiter.api.Assertions.assertEquals
65
import org.junit.jupiter.api.Test
@@ -9,7 +8,7 @@ import org.slf4j.LoggerFactory
98

109
private val logger = KotlinLogging.logger {}
1110
private val loggerFromSlf4j =
12-
KotlinLogging.logger(LoggerFactory.getLogger("io.github.oshai.kotlinlogging.slf4jLogger"))
11+
LoggerFactory.getLogger("io.github.oshai.kotlinlogging.slf4jLogger").toKLogger()
1312
private val loggerFromSlf4jExtension =
1413
LoggerFactory.getLogger("io.github.oshai.kotlinlogging.slf4jLoggerExtension").toKLogger()
1514

0 commit comments

Comments
 (0)