Skip to main content

Integration with Timber

Timber Introduction

Timber is a logger with a small, extensible API which provides utility on top of Android's normal Log class. While Timber itself does not support cloud-based log storage, it relies on external implementations of a "tree" system to enable this functionality. Shipbook offers a solution by providing visibility into all your app's issues and logs remotely. Integrating Shipbook with Timber creates a comprehensive logging solution.

Integrating with Timber

Just add the following code and it will work out of the box with timber.

ShipBook.addWrapperClass(Timber::class.java.name)
Timber.plant(object : Timber.Tree() {
override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
Log.message(tag, message, priority, t)
}
init {
ShipBook.addWrapperClass(this.javaClass.name)
}
})

Now you can use Timber as you normally would and all logs will be sent to Shipbook.