Skip to content

Commit

Permalink
global: plant the Timber log tree
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck authored and Bambooin committed Aug 14, 2021
1 parent 0e1101e commit 98e2772
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ android {
dependencies {
implementation 'org.ocpsoft.prettytime:prettytime:5.0.1.Final'
implementation 'com.blankj:utilcodex:1.30.6'
implementation 'com.jakewharton.timber:timber:5.0.1'
implementation "androidx.core:core-ktx:1.3.2"
implementation "androidx.appcompat:appcompat:1.3.0"
implementation "androidx.preference:preference-ktx:1.1.1"
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/com/osfans/trime/TrimeApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.osfans.trime

import android.app.Application
import com.osfans.trime.ime.core.Preferences
import timber.log.Timber

/**
* Custom Application class.
Expand All @@ -13,6 +14,9 @@ class TrimeApplication: Application() {
override fun onCreate() {
super.onCreate()
try {
if (BuildConfig.DEBUG) {
Timber.plant(Timber.DebugTree())
}
val prefs = Preferences.initDefault(this)
prefs.initDefaultPreferences()
} catch (e: Exception) {
Expand Down

0 comments on commit 98e2772

Please sign in to comment.