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

graphql.nadel.enginekt.log.NadelLog.kt Maven / Gradle / Ivy

Go to download

Nadel is a Java library that combines multiple GrahpQL services together into one API.

The newest version!
package graphql.nadel.enginekt.log

import org.slf4j.Logger

inline fun Logger.ifTraceEnabled(logFunc: Logger.() -> Unit) {
    if (isTraceEnabled) {
        logFunc()
    }
}

inline fun Logger.ifDebugEnabled(logFunc: Logger.() -> Unit) {
    if (isDebugEnabled) {
        logFunc()
    }
}

inline fun Logger.ifInfoEnabled(logFunc: Logger.() -> Unit) {
    if (isInfoEnabled) {
        logFunc()
    }
}

inline fun Logger.ifWarnEnabled(logFunc: Logger.() -> Unit) {
    if (isWarnEnabled) {
        logFunc()
    }
}

inline fun Logger.ifErrorEnabled(logFunc: Logger.() -> Unit) {
    if (isErrorEnabled) {
        logFunc()
    }
}

var kvImpl: (String, Any?) -> Any? = { key, value ->
    key to value
}

internal fun Logger.kv(key: String, value: Any?): Any? {
    return kvImpl(key, value)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy