<dependencies>
<dependency>
<groupId>io.github.microutils</groupId>
<artifactId>kotlin-logging</artifactId>
<version>VERSION</version>
</dependency>
</dependencies>
kotlin
import mu.KotlinLogging
kotlin
private val logger = KotlinLogging.logger {}
kotlin
logger.info("This is an information message.")
logger.debug { "This is a debug message: ${expensiveDebugMessage()}" }
logger.error(exception) { "An error occurred: ${exception.message}" }
kotlin
logger.level = KotlinLoggingLevel.INFO
kotlin
logger.withFormat { format { time } }.info("Custom format: $message")
kotlin
private val childLogger = logger.createChildLogger("ChildLogger")