Skip to content

Commit

Permalink
Initial setup of StrictMode - only logging in debug.
Browse files Browse the repository at this point in the history
  • Loading branch information
prashanDYDX committed Mar 13, 2024
1 parent 03422e4 commit 5e86600
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions v4/app/src/main/java/exchange/dydx/trading/DydxApplication.kt
Original file line number Diff line number Diff line change
@@ -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),
Expand Down

0 comments on commit 5e86600

Please sign in to comment.