File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
external/src/main/java/com/foke/together/external/camera/external/interceptor
util/src/main/java/com/foke/together/util/retrofit Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ class BaseUrlInterceptor: Interceptor {
1919
2020 fun setBaseUrl (newBaseUrl : String ) {
2121 baseUrl = newBaseUrl
22+ if (AppPolicy .isDebugMode) {
23+ AppLog .i(TAG , " setBaseUrl" , " set to: $newBaseUrl " )
24+ }
2225 try {
2326 val sep = newBaseUrl.indexOf(" ://" )
2427 scheme = newBaseUrl.substring(0 , sep)
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package com.foke.together.util.retrofit
33import com.foke.together.util.AppLog
44import com.foke.together.util.AppPolicy
55import okhttp3.Request
6+ import okhttp3.ResponseBody
67import okio.IOException
78import okio.Timeout
89import retrofit2.Call
@@ -17,6 +18,14 @@ class NetworkCall<T>(
1718 override fun onResponse (call : Call <T >, response : Response <T >) {
1819 if (AppPolicy .isDebugMode) {
1920 AppLog .e(TAG , " onResponse" , " success: $response " )
21+ AppLog .e(TAG , " onResponse" , " success: ${response.headers()} " )
22+
23+ val body = response.body() as ResponseBody
24+ AppLog .e(TAG , " onResponse" , " success: ${response.body()} " )
25+ AppLog .e(TAG , " onResponse" , " success: ${body.source()} " )
26+ AppLog .e(TAG , " onResponse" , " success: ${body.contentLength()} " )
27+ AppLog .e(TAG , " onResponse" , " success: ${body.contentType()} " )
28+ AppLog .e(TAG , " onResponse" , " success: ${body.bytes()} " )
2029 }
2130
2231 if (response.isSuccessful) {
You can’t perform that action at this time.
0 commit comments