jvmMain.com.github.michaelbull.logging.InlineLogger.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-inline-logger-jvm Show documentation
Show all versions of kotlin-inline-logger-jvm Show documentation
A logger facilitating lazily-evaluated log calls via Kotlin's inline classes & functions.
@file:Suppress("unused")
package com.github.michaelbull.logging
import org.slf4j.LoggerFactory
import java.lang.invoke.MethodHandles
import kotlin.reflect.KClass
@Suppress("NOTHING_TO_INLINE")
actual inline fun InlineLogger(): InlineLogger {
val delegate = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())
return InlineLogger(delegate)
}
@Suppress("NOTHING_TO_INLINE")
actual inline fun InlineLogger(name: String): InlineLogger {
val delegate = LoggerFactory.getLogger(name)
return InlineLogger(delegate)
}
@Suppress("NOTHING_TO_INLINE")
actual inline fun InlineLogger(clazz: KClass): InlineLogger {
val delegate = LoggerFactory.getLogger(clazz.java)
return InlineLogger(delegate)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy