在log4j2中,我们有一个方便的特性,它被描述为
// Java-8 style optimization: no need to explicitly check the log level:
// the lambda expression is not evaluated if the TRACE level is not enabled
logger.trace("Some long-running operation returned {}", () -> expensiveOperation());
我在Kotlin 使用这一点的try
log.debug("random {}", { UUID.randomUUID() })
哪个会打印
random Function0<java.util.UUID>
How do we use lambda argument logging with kotlin? Or how do we explicitly tell kotlin what method to call?