mirror of
https://github.com/jellyfin/jellyfin-android.git
synced 2026-09-03 05:10:27 +03:00
Enable logging in release builds
This commit is contained in:
@@ -3,6 +3,7 @@ package org.jellyfin.mobile
|
||||
import android.app.Application
|
||||
import android.webkit.WebView
|
||||
import org.jellyfin.mobile.model.databaseModule
|
||||
import org.jellyfin.mobile.utils.JellyTree
|
||||
import org.koin.android.ext.koin.androidContext
|
||||
import org.koin.androidx.fragment.koin.fragmentFactory
|
||||
import org.koin.core.context.startKoin
|
||||
@@ -11,10 +12,11 @@ import timber.log.Timber
|
||||
class JellyfinApplication : Application() {
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
if (BuildConfig.DEBUG) {
|
||||
// Setup logging
|
||||
Timber.plant(Timber.DebugTree())
|
||||
|
||||
// Setup logging
|
||||
Timber.plant(JellyTree())
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
// Enable WebView debugging
|
||||
WebView.setWebContentsDebuggingEnabled(true)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.jellyfin.mobile.utils
|
||||
|
||||
import android.util.Log
|
||||
import org.jellyfin.mobile.BuildConfig
|
||||
import timber.log.Timber
|
||||
|
||||
class JellyTree : Timber.DebugTree() {
|
||||
override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
|
||||
if (BuildConfig.DEBUG || priority >= Log.INFO) super.log(priority, tag, message, t)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user