kotlin.logging
class FooWithLogging {
companion object: KLogging()
fun bar() {
logger.info { "hello $name" }
}
fun logException(e: Exception) {
logger.error(e) { "Error occured" }
}
}
使用 kotlin.logging 框架
class FooWithLogging {
companion object: KLogging()
fun bar() {
logger.info { "hello $name" }
}
fun logException(e: Exception) {
logger.error(e) { "Error occured" }
}
}
使用 kotlin.logging 框架