skrypton-api / com.waicool20.skrypton.util / KLogger

KLogger

class KLogger

Class that wraps a Logger instance, and adds logging functions which receive lambdas as their argument. These functions are lazily evaluated.

Constructors

<init>

KLogger(logger: Logger)

Main constructor

Properties

logger

val logger: Logger

Logger instance to wrap.

Functions

debug

fun debug(msg: String): Unit

Just like Logger.debug

fun debug(msg: () -> Any): Unit

Executes given lambda and logs its result with Logger.debug. Allows lazy evaluation of logging message.

error

fun error(msg: String): Unit

Just like Logger.error

fun error(msg: () -> Any): Unit

Executes given lambda and logs its result with Logger.error. Allows lazy evaluation of logging message.

info

fun info(msg: String): Unit

Just like Logger.info

fun info(msg: () -> Any): Unit

Executes given lambda and logs its result with Logger.info. Allows lazy evaluation of logging message.

trace

fun trace(msg: String): Unit

Just like Logger.trace

fun trace(msg: () -> Any): Unit

Executes given lambda and logs its result with Logger.trace. Allows lazy evaluation of logging message.

warn

fun warn(msg: String): Unit

Just like Logger.warn

fun warn(msg: () -> Any): Unit

Executes given lambda and logs its result with Logger.warn. Allows lazy evaluation of logging message.