Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 1.58 KB

README.md

File metadata and controls

68 lines (50 loc) · 1.58 KB

log4kt

GitHub last commit GitHub tag (latest by date) GitHub Lines of code Discord Badge

A very simple SLF4J implementation written in Kotlin.

Installation

Gradle

dependencies {
    compile "com.zp4rker:log4kt:VERSION"
}

Maven

<dependency>
    <groupId>com.zp4rker</groupId>
    <artifactId>log4kt</artifactId>
    <version>VERSION</version>
</dependency>

Current features

EventListener

A very simple logging event listener. Usage is as below:

Log4KtEventListener.on<Log4KtLogEvent> {
    if (it.t == null) return@on
    logger.debug("an exception was printed")
}

Currently supported events

  • Log4KtLogEvent
    • Fired after a log is printed/sent.
  • Log4KtPrepareLogEvent
    • Fired before a log is printed/sent.
    • Level and message can be modified in this event.
    • Event is also cancellable.

Coloured Output (Jansi)

By default, it will colourise the output using Jansi. To disable this feature, simply exclude Jansi as a dependency.

For example:

dependencies {
    compile ("com.zp4rker:log4kt:1.1.1") {
        exclude group: "org.fusesource.jansi", module: "jansi"
    }
}