Skip to content

AntonHolovin/TimberDialog

Repository files navigation

TimberDialog

Simple dialog which lets to check the logs from Timber. Logs can be shared as .log file.

Based on the dialog from u2020 app.

Demo

Add dependency

Add it in your root build.gradle:

allprojects {
    repositories {
        // ...
        maven { url "https://jitpack.io" }
    }
}

Add the dependency:

dependencies {
    debugImplementation 'com.github.antonygolovin:timberdialog:0.1'
}

Plant a tree

Use LumberYard class:

class App : Application() {
    override fun onCreate() {
        super.onCreate()

        Timber.plant(Timber.DebugTree())

        LumberYard.getInstance(this).let {
            it.cleanUp()
            Timber.plant(it.tree())
        }
    }
}

Edit app's AndroidManifest.xml

Add provider inside <application> node:

<provider
    android:name="android.support.v4.content.FileProvider"
    android:authorities="${applicationId}"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/file_paths" />
    </provider>

Add res/xml/file_paths.xml:

<?xml version="1.0" encoding="utf-8"?>
<paths>
    <external-path
        name="logs"
        path="/" />
</paths>

About

The dialog which shows Timber logs. Based on the dialog from u2020 app

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages