File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
mvvm/src/main/java/com/catchpig/mvvm/network/manager Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 11# CHANGE LOG
22
3+ ### 1.5.1
4+
5+ + 日志打印拦截器不再判断是否是debug模式,默认都打印日志
6+
37### 1.5.0
48
59+ 解决服务器返回异常错误码,data为null的问题
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package com.catchpig.mvvm.network.manager
33import com.catchpig.mvvm.entity.ServiceParam
44import com.catchpig.mvvm.ksp.KotlinMvvmCompiler
55import com.catchpig.mvvm.network.factory.SerializationConverterFactory
6- import com.catchpig.utils.ext.logd
6+ import com.catchpig.utils.ext.logi
77import okhttp3.OkHttpClient
88import okhttp3.logging.HttpLoggingInterceptor
99import retrofit2.Retrofit
@@ -80,15 +80,15 @@ class NetManager private constructor() {
8080 * 读取数据超时时间
8181 */
8282 .readTimeout(serviceParam.readTimeout, TimeUnit .MILLISECONDS )
83+ val loggingInterceptor = HttpLoggingInterceptor {
84+ it.logi(TAG )
85+ }
86+ loggingInterceptor.setLevel(HttpLoggingInterceptor .Level .BODY )
87+ builder = builder.addInterceptor(loggingInterceptor)
8388 if (debug && serviceParam.debug) {
8489 serviceParam.debugInterceptors.forEach {
8590 builder = builder.addInterceptor(it)
8691 }
87- val loggingInterceptor = HttpLoggingInterceptor {
88- it.logd(TAG )
89- }
90- loggingInterceptor.setLevel(HttpLoggingInterceptor .Level .BODY )
91- builder = builder.addInterceptor(loggingInterceptor)
9292 }
9393 if (sslParamMap.contains(serviceClass)) {
9494 val sslParam = sslParamMap[serviceClass]
You can’t perform that action at this time.
0 commit comments