Skip to content

Instantly share code, notes, and snippets.

@ktvipin27
Last active June 11, 2020 14:23
Show Gist options
  • Select an option

  • Save ktvipin27/ed6a877c88d88e0ef31a5811bf97631d to your computer and use it in GitHub Desktop.

Select an option

Save ktvipin27/ed6a877c88d88e0ef31a5811bf97631d to your computer and use it in GitHub Desktop.
Sample application class with Timber configuration for pushing logs to Firebase realtime database.
class TimberRemoteApp : Application() {
@SuppressLint("HardwareIds")
override fun onCreate() {
super.onCreate()
if (BuildConfig.DEBUG) {
val deviceId = Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID)
val deviceDetails = DeviceDetails(deviceId)
val remoteTree = TimberRemoteTree(deviceDetails)
Timber.plant(remoteTree)
} else {
//TODO plant timber release tree.
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment