Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial setup of StrictMode - only logging in debug. #22

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
prashanDYDX marked this conversation as resolved.
Show resolved Hide resolved
prashanDYDX marked this conversation as resolved.
Show resolved Hide resolved
private val logger = DydxLogger()
prashanDYDX marked this conversation as resolved.
Show resolved Hide resolved

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
Loading