All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.com.github.michaelbull.logging.InlineLogger.kt Maven / Gradle / Ivy

Go to download

A logger facilitating lazily-evaluated log calls via Kotlin's inline classes & functions.

There is a newer version: 1.0.6
Show newest version
@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