This library provides following main features:
- simply lazy evalution based logger based on a
Lclass for the shortest possible log codes - easily extendible with custom loggers
- offers console and file logger implementations
- supports log filtering
- providers a viewer for log files
![]() |
![]() |
![]() |
![]() |
| Module | android | iOS | windows | macOS | wasm | Notes |
|---|---|---|---|---|---|---|
| core | β | β | β | β | β | the core module of lumberjack |
| logger-console | β | β | β | β | β | a console logger for lumberjack |
| logger-file | β | β | β | β | β | a file logger for lumberjack |
| extension-composeviewer | β | β | β | β | β | a compose viewer for lumberjack |
| extension-feedback | β | β | β | β | β | a feedback module for lumberjack |
| Dependency | Version |
|---|---|
| Kotlin | 2.4.0 |
| Jetbrains Compose | 1.11.1 |
| Jetbrains Compose Material3 | 1.9.0 |
β οΈ Following experimental annotations are used:
- OptIn
androidx.compose.material3.ExperimentalMaterial3Api(3x)kotlinx.cinterop.ExperimentalForeignApi(1x)I try to use as less experimental features as possible, but in this case the ones above are needed!
Using Version Catalogs
Define the dependencies inside your libs.versions.toml file.
[versions]
lumberjack = "<LATEST-VERSION>"
[libraries]
lumberjack-core = { module = "io.github.mflisar.lumberjack:core", version.ref = "lumberjack" }
lumberjack-logger-console = { module = "io.github.mflisar.lumberjack:logger-console", version.ref = "lumberjack" }
lumberjack-logger-file = { module = "io.github.mflisar.lumberjack:logger-file", version.ref = "lumberjack" }
lumberjack-extension-composeviewer = { module = "io.github.mflisar.lumberjack:extension-composeviewer", version.ref = "lumberjack" }
lumberjack-extension-feedback = { module = "io.github.mflisar.lumberjack:extension-feedback", version.ref = "lumberjack" }And then use the definitions in your projects build.gradle.kts file like following:
implementation(libs.lumberjack.core)
implementation(libs.lumberjack.logger.console)
implementation(libs.lumberjack.logger.file)
implementation(libs.lumberjack.extension.composeviewer)
implementation(libs.lumberjack.extension.feedback)Direct Dependency Notation
Simply add the dependencies inside your build.gradle.kts file.
val lumberjack = "<LATEST-VERSION>"
implementation("io.github.mflisar.lumberjack:core:${lumberjack}")
implementation("io.github.mflisar.lumberjack:logger-console:${lumberjack}")
implementation("io.github.mflisar.lumberjack:logger-file:${lumberjack}")
implementation("io.github.mflisar.lumberjack:extension-composeviewer:${lumberjack}")
implementation("io.github.mflisar.lumberjack:extension-feedback:${lumberjack}")// 1) register a console logger
L.plant(ConsoleLogger())
// 2) register a file logger
val setup = FileLoggerSetup.Daily(folder = FileLoggerSetup.getDefaultLogFolder())
// or one of the following setups
//val setup = FileLoggerSetup.FileSize(folder = FileLoggerSetup.getDefaultLogFolder())
//val setup = FileLoggerSetup.SingleFile(folder = FileLoggerSetup.getDefaultLogFolder())
L.plant(FileLogger(setup))
L.d { "Some log" }
L.e(Exception("TEST")) { "Some log with exception" }
L.logIf { false }?.d {
// this block will never be executed thanks to lazy evaluation
"this log will never be printed nor will this block ever be executed"
}
// examples with tags and types
L.tag("Custom Tag").v { "Verbose log..." }
L.tag("Custom Tag").d { "Debug log..." }
L.tag("Custom Tag").i { "Info log..." }
L.tag("Custom Tag").w { "Warn log..." }
L.tag("Custom Tag").e { "Error log..." }
L.tag("Custom Tag").wtf { "WTF log..." }
A full demo is included inside the demo module, it shows nearly every usage with working examples.
- Advanced
- Migration
Check out the API documentation.
You can find more of my multiplatform libraries that work well together here.
When combining my libraries, you can find compatibility information here.



