nfrankel / slf4k

Home Page:https://blog.frankel.ch/smart-logging-in-java8-kotlin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SLF4K

This library is a thin Kotlin wrapper around the SLF4 API to lazily evaluate messages and arguments passed to the logger methods.

The following snippet will call expensiveOperation() regardless of the log priority level:

LOGGER.debug("A message with an ", expensiveOperation())

The library aims to offer the following:

LOGGER.debug("A message with an ") { expensiveOperation() }

With this, expensiveOperation() will get called only if the log priority is set to DEBUG or lower.

About

https://blog.frankel.ch/smart-logging-in-java8-kotlin


Languages

Language:Kotlin 100.0%