Kloggs is a single-file Kotlin utility adding lambda-based logging methods over slf4j. These methods have a performance advantage over string concatenation and are more elegant than parameterized methods. Kloggs is a play on the cereal brand. The library (if you can call it that) is available under MIT License.
Kloggs is available on Maven through Jitpack.
Maven:
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.User</groupId>
<artifactId>Repo</artifactId>
<version>Tag</version>
</dependency>
Gradle:
repositories {
...
maven { url 'https://jitpack.io' }
}
dependencies {
compile 'com.github.User:Repo:Tag'
}
1. Get a logger.
private val log = logger<MyFavoriteClass>()
class MyFavoriteClass
2. Use the logger.
log.info { "User $username has logged in!" }
3. The end.