Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. class TimberConfig : ApplicationConfig {
  2.  
  3. override fun configure() {
  4. if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())
  5. else Timber.plant(CrashlyticsTree())
  6. }
  7.  
  8. inner class CrashlyticsTree : Timber.Tree() {
  9. override fun log(priority: Int, tag: String, message: String, throwable: Throwable?) {
  10. if (priority == Log.VERBOSE || priority == Log.DEBUG) return
  11.  
  12. Crashlytics.log(priority, tag, message)
  13. throwable?.let { Crashlytics.logException(it) }
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement