Skip to content

quentin7b/koin-timber-logger

Repository files navigation

Koin Timber Logger

Version 3.0.0 Hosted on Jitpack.io

TL;DR A simple logger for Koin that uses Timber

Usage

Use it as the optional logger parameter of startKoin

For example

startKoin{
    ...  
    TimberLogger()
}

Options

The constructor has multiple arguments that you can use to customise the behavior.

param role default
showDebug display d messages or not true
showErr display e messages or not true
showInfo display i messages or not true
tag
tag used by timber as Timber.tag(??).x()
if null it uses Timber.x() directly
null

For example, if you want to use the tag Koin and only display error messages, then you can use

TimberLogger(
  showDebug = false,  
  showInfo = false,  
  tag = "Koin"  
)

Install

Add it over jitpack.io

In the project build.gradle

allprojects {  
    repositories {  
        jcenter()  
        // Maybe google()  
        maven { url "https://jitpack.io" }  
    }  
}  

In the module build.gradle

dependencies {  
    implementation 'com.github.quentin7b:koin-timber-logger:3.0.0'
}  

License

Project is under Apache 2
Feel free to improve by opening an issue or a pull request