Skip to content

Minikloon/Kloggs

Repository files navigation

Kloggs logo Kloggs

Build Status Download

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.

Install

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'
}

Usage

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.

About

The simplest Kotlin + slf4j

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages