mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20:30 +05:30
fix: http logging in debug builds not working due to cronet
This commit is contained in:
parent
e49f3e4b85
commit
7ac50280fd
@ -67,7 +67,6 @@ object RetrofitInstance {
|
|||||||
|
|
||||||
private fun buildClient(): OkHttpClient {
|
private fun buildClient(): OkHttpClient {
|
||||||
val httpClient = OkHttpClient().newBuilder()
|
val httpClient = OkHttpClient().newBuilder()
|
||||||
.addInterceptor(CronetInterceptor.newBuilder(CronetHelper.cronetEngine).build())
|
|
||||||
|
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
val loggingInterceptor = HttpLoggingInterceptor().apply {
|
val loggingInterceptor = HttpLoggingInterceptor().apply {
|
||||||
@ -77,6 +76,8 @@ object RetrofitInstance {
|
|||||||
httpClient.addInterceptor(loggingInterceptor)
|
httpClient.addInterceptor(loggingInterceptor)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
httpClient.addInterceptor(CronetInterceptor.newBuilder(CronetHelper.cronetEngine).build())
|
||||||
|
|
||||||
return httpClient.build()
|
return httpClient.build()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,6 @@ object ImageHelper {
|
|||||||
val maxCacheSize = PreferenceHelper.getString(PreferenceKeys.MAX_IMAGE_CACHE, "128")
|
val maxCacheSize = PreferenceHelper.getString(PreferenceKeys.MAX_IMAGE_CACHE, "128")
|
||||||
|
|
||||||
val httpClient = OkHttpClient().newBuilder()
|
val httpClient = OkHttpClient().newBuilder()
|
||||||
.addInterceptor(CronetInterceptor.newBuilder(CronetHelper.cronetEngine).build())
|
|
||||||
|
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
val loggingInterceptor = HttpLoggingInterceptor().apply {
|
val loggingInterceptor = HttpLoggingInterceptor().apply {
|
||||||
@ -47,6 +46,8 @@ object ImageHelper {
|
|||||||
httpClient.addInterceptor(loggingInterceptor)
|
httpClient.addInterceptor(loggingInterceptor)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
httpClient.addInterceptor(CronetInterceptor.newBuilder(CronetHelper.cronetEngine).build())
|
||||||
|
|
||||||
imageLoader = ImageLoader.Builder(context)
|
imageLoader = ImageLoader.Builder(context)
|
||||||
.callFactory(CronetHelper.callFactory)
|
.callFactory(CronetHelper.callFactory)
|
||||||
.crossfade(true)
|
.crossfade(true)
|
||||||
|
Loading…
Reference in New Issue
Block a user