jvmMain.mu.KotlinLogging.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonarlint-core Show documentation
Show all versions of sonarlint-core Show documentation
Common library used by some SonarLint flavors
package mu
import mu.internal.KLoggerFactory
import org.slf4j.Logger
actual object KotlinLogging {
/**
* This method allow defining the logger in a file in the following way:
* ```
* val logger = KotlinLogging.logger {}
* ```
*/
actual fun logger(func: () -> Unit): KLogger = KLoggerFactory.logger(func)
actual fun logger(name: String): KLogger = KLoggerFactory.logger(name)
fun logger(underlyingLogger: Logger) = KLoggerFactory.wrapJLogger(underlyingLogger)
}
fun Logger.toKLogger() = KotlinLogging.logger(this)