Add Chucker network debugging library
This commit is contained in:
@@ -216,4 +216,7 @@ dependencies {
|
|||||||
|
|
||||||
// https://github.com/square/leakcanary/releases
|
// https://github.com/square/leakcanary/releases
|
||||||
debugImplementation "com.squareup.leakcanary:leakcanary-android:2.9.1"
|
debugImplementation "com.squareup.leakcanary:leakcanary-android:2.9.1"
|
||||||
|
|
||||||
|
// https://github.com/ChuckerTeam/chucker/releases
|
||||||
|
debugImplementation "com.github.chuckerteam.chucker:library:3.5.2"
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
package gq.kirmanak.mealient.di
|
package gq.kirmanak.mealient.di
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import com.chuckerteam.chucker.api.ChuckerCollector
|
||||||
|
import com.chuckerteam.chucker.api.ChuckerInterceptor
|
||||||
|
import com.chuckerteam.chucker.api.RetentionManager
|
||||||
import com.facebook.flipper.core.FlipperPlugin
|
import com.facebook.flipper.core.FlipperPlugin
|
||||||
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin
|
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin
|
||||||
import com.facebook.flipper.plugins.inspector.DescriptorMapping
|
import com.facebook.flipper.plugins.inspector.DescriptorMapping
|
||||||
@@ -38,6 +41,21 @@ object DebugModule {
|
|||||||
return interceptor
|
return interceptor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
@IntoSet
|
||||||
|
fun provideChuckerInterceptor(@ApplicationContext context: Context): Interceptor {
|
||||||
|
val collector = ChuckerCollector(
|
||||||
|
context = context,
|
||||||
|
showNotification = true,
|
||||||
|
retentionPeriod = RetentionManager.Period.ONE_HOUR,
|
||||||
|
)
|
||||||
|
return ChuckerInterceptor.Builder(context)
|
||||||
|
.collector(collector)
|
||||||
|
.alwaysReadResponseBody(true)
|
||||||
|
.build()
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
@IntoSet
|
@IntoSet
|
||||||
|
|||||||
Reference in New Issue
Block a user