diff --git a/.idea/git_toolbox_prj.xml b/.idea/git_toolbox_prj.xml new file mode 100644 index 0000000..b382006 --- /dev/null +++ b/.idea/git_toolbox_prj.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/foudations/mogo-network/src/main/java/com/mogo/cloud/network/interceptor/HttpLoggingInterceptor.kt b/foudations/mogo-network/src/main/java/com/mogo/cloud/network/interceptor/HttpLoggingInterceptor.kt index 5a2b7bd..5e18166 100644 --- a/foudations/mogo-network/src/main/java/com/mogo/cloud/network/interceptor/HttpLoggingInterceptor.kt +++ b/foudations/mogo-network/src/main/java/com/mogo/cloud/network/interceptor/HttpLoggingInterceptor.kt @@ -42,15 +42,16 @@ class HttpLoggingInterceptor : Interceptor { } val logMsg = StringBuilder() - .append("------> http request start").append("\r\n") - .append(protocol).append(", ") - .append(request.method()).append("\r\n") - .append("Request Headers: {").append(request.headers().toString().replace("\n",", ")).append("}\r\n") - .append("Url: ").append(request.url()).append("\r\n") - .append("Content-Type: ").append(requestBody?.contentType()).append("\r\n") - .append("Content-Length: ").append(requestBody?.contentLength()).append("\r\n") - .append("Content-body: ").append(body).append("\r\n") - .append("------> http request end").append("\r\n").append("\r\n") + .append("------> http request start").append("\r\n") + .append(protocol).append(", ") + .append(request.method()).append("\r\n") + .append("Request Headers: {").append(request.headers().toString().replace("\n", ", ")) + .append("}\r\n") + .append("Url: ").append(request.url()).append("\r\n") + .append("Content-Type: ").append(requestBody?.contentType()).append("\r\n") + .append("Content-Length: ").append(requestBody?.contentLength()).append("\r\n") + .append("Content-body: ").append(body).append("\r\n") + .append("------> http request end").append("\r\n").append("\r\n") val startTime = System.nanoTime() @@ -72,16 +73,21 @@ class HttpLoggingInterceptor : Interceptor { } logMsg.append("------> http response start").append("\r\n") - .append(response.code()).append(" ") - .append(response.message()).append(" ") - .append(response.protocol()).append(" ").append("\r\n") - .append("Response Content: ").append(responseContent).append("\r\n") - .append("Content-Type: ").append(contentType).append("\r\n") - .append("Content-Length: ").append(bodySize).append("\r\n") - .append("Time: (").append(endTime).append("ms)").append("\r\n") - .append("------> http response end") - Logger.d(TAG, logMsg.toString()) - return if (consumedResponse) response.newBuilder().body(ResponseBody.create(contentType, responseContent)).build() else response + .append(response.code()).append(" ") + .append(response.message()).append(" ") + .append(response.protocol()).append(" ").append("\r\n") + .append("Response Content: ").append(responseContent).append("\r\n") + .append("Content-Type: ").append(contentType).append("\r\n") + .append("Content-Length: ").append(bodySize).append("\r\n") + .append("Time: (").append(endTime).append("ms)").append("\r\n") + .append("------> http response end") + if (response.code() != 200) { + Logger.e(TAG, logMsg.toString()) + } else { + Logger.d(TAG, logMsg.toString()) + } + return if (consumedResponse) response.newBuilder() + .body(ResponseBody.create(contentType, responseContent)).build() else response } } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index a5baecc..7dea2a9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -36,22 +36,22 @@ PASSWORD=xintai2018 RELEASE=true # AI CLOUD 云平台 # 工具类 -MOGO_UTILS_VERSION=1.3.3 +MOGO_UTILS_VERSION=1.3.4 # 网络请求 -MOGO_NETWORK_VERSION=1.3.3 +MOGO_NETWORK_VERSION=1.3.4 # 网络DNS -MOGO_HTTPDNS_VERSION=1.3.3 +MOGO_HTTPDNS_VERSION=1.3.4 # 鉴权 -MOGO_PASSPORT_VERSION=1.3.3 +MOGO_PASSPORT_VERSION=1.3.4 # 常链接 -MOGO_SOCKET_VERSION=1.3.3 +MOGO_SOCKET_VERSION=1.3.4 # 数据采集 -MOGO_REALTIME_VERSION=1.3.3 +MOGO_REALTIME_VERSION=1.3.4 # 探路,道路事件发布,获取 -MOGO_TANLU_VERSION=1.3.3 +MOGO_TANLU_VERSION=1.3.4 # 直播推流 -MOGO_LIVE_VERSION=1.3.3 +MOGO_LIVE_VERSION=1.3.4 # 直播拉流 -MOGO_TRAFFICLIVE_VERSION=1.3.3 +MOGO_TRAFFICLIVE_VERSION=1.3.4 # 定位服务 -MOGO_LOCATION_VERSION=1.3.3 +MOGO_LOCATION_VERSION=1.3.4