mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
40 lines
1 KiB
Kotlin
40 lines
1 KiB
Kotlin
package com.github.damontecres.dolphin
|
|
|
|
import android.app.Application
|
|
import android.util.Log
|
|
import dagger.hilt.android.HiltAndroidApp
|
|
import timber.log.Timber
|
|
|
|
@HiltAndroidApp
|
|
class DolphinApplication : Application() {
|
|
init {
|
|
instance = this
|
|
|
|
if (BuildConfig.DEBUG) {
|
|
Timber.plant(Timber.DebugTree())
|
|
} else {
|
|
Timber.plant(
|
|
object : Timber.Tree() {
|
|
override fun isLoggable(
|
|
tag: String?,
|
|
priority: Int,
|
|
): Boolean = priority >= Log.INFO
|
|
|
|
override fun log(
|
|
priority: Int,
|
|
tag: String?,
|
|
message: String,
|
|
t: Throwable?,
|
|
) {
|
|
Log.println(priority, tag ?: "Dolphin", message)
|
|
}
|
|
},
|
|
)
|
|
}
|
|
}
|
|
|
|
companion object {
|
|
lateinit var instance: DolphinApplication
|
|
private set
|
|
}
|
|
}
|