Logger

fun interface Logger

A functional interface for logging messages.

This interface defines a single abstract method, log, which can be implemented by a lambda expression to provide a simple logging mechanism.

Example usage:

val consoleLogger = Logger { message -> println("LOG: $message") }
consoleLogger.log("This is a test message.")

Functions

Link copied to clipboard
abstract fun log(message: String)
Link copied to clipboard
fun Logger.withDateTime(clock: Clock = Clock.System): Logger
Link copied to clipboard

Creates a new logger that decorates messages with the name of the thread where the log was invoked.

Link copied to clipboard