Skip to content

Commit

Permalink
Merge pull request #5979 from Bnyro/master
Browse files Browse the repository at this point in the history
fix: http logging in debug builds not working due to cronet
  • Loading branch information
Bnyro committed May 5, 2024
2 parents e49f3e4 + 7ac5028 commit fda352e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ object RetrofitInstance {

private fun buildClient(): OkHttpClient {
val httpClient = OkHttpClient().newBuilder()
.addInterceptor(CronetInterceptor.newBuilder(CronetHelper.cronetEngine).build())

if (BuildConfig.DEBUG) {
val loggingInterceptor = HttpLoggingInterceptor().apply {
Expand All @@ -77,6 +76,8 @@ object RetrofitInstance {
httpClient.addInterceptor(loggingInterceptor)
}

httpClient.addInterceptor(CronetInterceptor.newBuilder(CronetHelper.cronetEngine).build())

return httpClient.build()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ object ImageHelper {
val maxCacheSize = PreferenceHelper.getString(PreferenceKeys.MAX_IMAGE_CACHE, "128")

val httpClient = OkHttpClient().newBuilder()
.addInterceptor(CronetInterceptor.newBuilder(CronetHelper.cronetEngine).build())

if (BuildConfig.DEBUG) {
val loggingInterceptor = HttpLoggingInterceptor().apply {
Expand All @@ -47,6 +46,8 @@ object ImageHelper {
httpClient.addInterceptor(loggingInterceptor)
}

httpClient.addInterceptor(CronetInterceptor.newBuilder(CronetHelper.cronetEngine).build())

imageLoader = ImageLoader.Builder(context)
.callFactory(CronetHelper.callFactory)
.crossfade(true)
Expand Down

0 comments on commit fda352e

Please sign in to comment.