Disable extra OkHttp logging
This commit is contained in:
@@ -24,6 +24,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildConfigField "Boolean", "DEBUG_PICASSO", "false"
|
buildConfigField "Boolean", "DEBUG_PICASSO", "false"
|
||||||
|
buildConfigField "Boolean", "LOG_NETWORK", "false"
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import dagger.hilt.InstallIn
|
|||||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||||
import dagger.hilt.components.SingletonComponent
|
import dagger.hilt.components.SingletonComponent
|
||||||
import dagger.multibindings.IntoSet
|
import dagger.multibindings.IntoSet
|
||||||
|
import gq.kirmanak.mealient.BuildConfig
|
||||||
import leakcanary.LeakCanary
|
import leakcanary.LeakCanary
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
import okhttp3.logging.HttpLoggingInterceptor
|
import okhttp3.logging.HttpLoggingInterceptor
|
||||||
@@ -30,7 +31,10 @@ object DebugModule {
|
|||||||
@IntoSet
|
@IntoSet
|
||||||
fun provideLoggingInterceptor(): Interceptor {
|
fun provideLoggingInterceptor(): Interceptor {
|
||||||
val interceptor = HttpLoggingInterceptor { message -> Timber.tag("OkHttp").v(message) }
|
val interceptor = HttpLoggingInterceptor { message -> Timber.tag("OkHttp").v(message) }
|
||||||
interceptor.level = HttpLoggingInterceptor.Level.BODY
|
interceptor.level = when {
|
||||||
|
BuildConfig.LOG_NETWORK -> HttpLoggingInterceptor.Level.BODY
|
||||||
|
else -> HttpLoggingInterceptor.Level.BASIC
|
||||||
|
}
|
||||||
return interceptor
|
return interceptor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user