Getting Started¶
Requirements¶
- JDK
21from the project toolchain - Gradle wrapper
9.3.1 - Kotlin
2.3.20 - Android
minSdk 20andcompileSdk 36for Android consumers
Add the dependency¶
Plant a default oak¶
DebugOak gives you the default platform behavior.
Log something¶
Lumber.verbose("Trace message")
Lumber.debug("User %s signed in", userName)
Lumber.info("Request finished in %d ms", elapsedMs)
Lumber.warn("Cache miss for %s", key)
Lumber.error(exception, "Unexpected failure")
Lumber.wtf("This should never happen")
Add context¶
Use tag() for a one-shot tag on the next log call.
Use your own oak¶
class AnalyticsOak : Lumber.Oak() {
override fun isLoggable(tag: String?, level: Lumber.Level) = level >= Lumber.Level.Info
override fun log(level: Lumber.Level, tag: String?, message: String, error: Throwable?) {
Analytics.track(level.name, tag, message, error)
}
}
Lumber.plant(AnalyticsOak())
Compatibility notes¶
- Android support starts at
minSdk 20. - The build uses the Gradle toolchain with Foojay resolution for JDK
21. - The published API follows the same KDoc and Dokka HTML reference as the source code.
- If setup, platform behavior, or API shape changes, update this guide together with the generated API reference.