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

library.LoggerExtensions.kt Maven / Gradle / Ivy

Go to download

This is a kotlin based domain specific language (dsl), to quickly and intuitively write custom DoIP ECU simulations.

The newest version!
package library

import org.slf4j.Logger

public inline fun Logger.traceIf(t: Throwable? = null, supplier: () -> String) {
    if (this.isTraceEnabled) {
        this.trace(supplier.invoke(), t)
    }
}

public inline fun Logger.debugIf(t: Throwable? = null, supplier: () -> String) {
    if (this.isDebugEnabled) {
        this.debug(supplier.invoke(), t)
    }
}

public inline fun Logger.infoIf(t: Throwable? = null, supplier: () -> String) {
    if (this.isInfoEnabled) {
        this.info(supplier.invoke(), t)
    }
}

public inline fun Logger.errorIf(t: Throwable? = null, supplier: () -> String) {
    if (this.isErrorEnabled) {
        this.error(supplier.invoke(), t)
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy