igrmk / dull

Dull & undeveloped logging library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dull & undeveloped logging library

This is the dumbest file logger ever written in Kotlin (34 LoC). Whenever the file exceeds halvingSize parameter oldest half of logs is removed. It is not recommended to use this logger for huge files. It reads logs as text every time it halves them. On my notebook halving of 1MB log file takes 5ms in average (quadratic mean). Worst case is 70ms.

Installation

Just copy dull.kt or use Gradle

dependencies {
    implementation 'com.github.igrmk:dull:1.0'
}

Usage

val log = com.github.igrmk.dull.FileLogger(file, 100000)
log.append("Hello world!")
println("Complete logs: ${log.get()}")

About

Dull & undeveloped logging library

License:MIT License


Languages

Language:Kotlin 100.0%