37 lines
889 B
Kotlin
37 lines
889 B
Kotlin
package ma.tkgraph.xtreamtv
|
|
|
|
import android.app.Application
|
|
import timber.log.Timber
|
|
|
|
/**
|
|
* Point d'entrée de l'application iMedia TV+.
|
|
* Configure le logging et l'injection de dépendances.
|
|
*/
|
|
class XtreamApplication : Application() {
|
|
|
|
/** Container d'injection de dépendances (manual DI). */
|
|
lateinit var appContainer: AppContainer
|
|
private set
|
|
|
|
override fun onCreate() {
|
|
super.onCreate()
|
|
instance = this
|
|
appContainer = AppContainer(this)
|
|
initLogging()
|
|
}
|
|
|
|
private fun initLogging() {
|
|
if (BuildConfig.ENABLE_LOGGING) {
|
|
Timber.plant(Timber.DebugTree())
|
|
} else {
|
|
// En production : Crashlytics tree (à configurer)
|
|
// Timber.plant(CrashReportingTree())
|
|
}
|
|
}
|
|
|
|
companion object {
|
|
lateinit var instance: XtreamApplication
|
|
private set
|
|
}
|
|
}
|