https://github.com/igrmk/dull
Dull & undeveloped logging library
https://github.com/igrmk/dull
kotlin kotlin-library logging logging-library
Last synced: about 1 year ago
JSON representation
Dull & undeveloped logging library
- Host: GitHub
- URL: https://github.com/igrmk/dull
- Owner: igrmk
- License: mit
- Created: 2020-04-07T17:38:55.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-27T17:47:39.000Z (about 6 years ago)
- Last Synced: 2024-09-30T09:14:04.784Z (over 1 year ago)
- Topics: kotlin, kotlin-library, logging, logging-library
- Language: Kotlin
- Size: 54.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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
```gradle
dependencies {
implementation 'com.github.igrmk:dull:1.0'
}
```
Usage
-----
```kotlin
val log = com.github.igrmk.dull.FileLogger(file, 100000)
log.append("Hello world!")
println("Complete logs: ${log.get()}")
```