RxAndroidLogger is Android Logcat library. It using with Timber, RxJava and Dopbox Api library. It can save logcat to file, then store to dropbox.
Timber: https://github.com/JakeWharton/timber
Dropbox: https://github.com/dropbox/dropbox-sdk-java
This repository is developing
-
In the
onCreate
of your application class:LogSetup.Builder options = new LogSetup.Builder(); options.setDropboxAccessToken("<YOUR DROPBOX ACCESS TOKEN>"); // example: "JM5srPDuSpMAAAAAAAAUmLljWVbGxYfdy7T3W_Dsh1Sv8B7-7H87QTgdWghuQAR-" options.setDropboxPath("<YOUR DROPBOX PATH>"); // example: "/TPBLog" TBPLogHelper.create(this, options.build()); Timber.plant(TBPLogHelper.getInstance().getTBPDebugTree());
(Tip: You can generate an access token for your own account through the App Console).
-
Call Timber.v(...), Timber.d(...), Timber.i(...), Timber.e(...) for logcat in your app
-
When store log file to DropBox:
TBPLogHelper.getInstance().storeDropBox() .subscribe(path -> <<STORE DropBox IS SUCCESS>>, throwable -> <<STORE DropBox IS FAILED>>);
Check out the sample app in
sample/
to see it in action.
- Add the dependency
dependencies { implementation "com.mysoftsource.rxandroidlogger:rxandroidlogger:1.0.6" implementation "com.jakewharton.timber:timber:4.5.1" implementation "io.reactivex:rxandroid:1.1.0" implementation "io.reactivex:rxjava:1.3.2" }
- Add in manifest file:
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
- In proguard file:
-dontwarn okio.** -dontwarn okhttp3.** -dontwarn com.squareup.okhttp.** -dontwarn com.google.appengine.** -dontwarn javax.servlet.**