From 5e8660083237103c1fb994f4b2dffece9040377c Mon Sep 17 00:00:00 2001 From: Prashan Dharmasena Date: Wed, 13 Mar 2024 11:03:06 -0400 Subject: [PATCH] Initial setup of StrictMode - only logging in debug. --- .../exchange/dydx/trading/DydxApplication.kt | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/v4/app/src/main/java/exchange/dydx/trading/DydxApplication.kt b/v4/app/src/main/java/exchange/dydx/trading/DydxApplication.kt index edcc8aff..5fd39ab7 100644 --- a/v4/app/src/main/java/exchange/dydx/trading/DydxApplication.kt +++ b/v4/app/src/main/java/exchange/dydx/trading/DydxApplication.kt @@ -1,26 +1,36 @@ package exchange.dydx.trading import android.app.Application +import android.os.StrictMode import com.facebook.stetho.Stetho import dagger.hilt.android.HiltAndroidApp import exchange.dydx.abacus.jvm.AbacusAndroid -import exchange.dydx.platformui.designSystem.theme.ThemeSettings import exchange.dydx.trading.common.AppConfig import exchange.dydx.trading.common.logger.DydxLogger import timber.log.Timber -import javax.inject.Inject @HiltAndroidApp class DydxApplication : Application() { - @Inject lateinit var logger: DydxLogger - - @Inject lateinit var themeSettings: ThemeSettings + private val logger = DydxLogger() override fun onCreate() { super.onCreate() if (BuildConfig.DEBUG) { + StrictMode.setThreadPolicy( + StrictMode.ThreadPolicy.Builder() + .detectAll() + .penaltyLog() + .build(), + ) + StrictMode.setVmPolicy( + StrictMode.VmPolicy.Builder() + .detectAll() + .penaltyLog() + .build(), + ) + Timber.plant( logger.debugTree, logger.woodTree(this),