From 524a7135c30a6a3401adc4823ee0d88c76cefa3e Mon Sep 17 00:00:00 2001 From: DesignQu <250533855@qq.com> Date: Mon, 7 May 2018 10:23:19 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=A0=B8=E5=BF=83=E5=8C=85=E5=90=8D=E5=8F=8A=E7=B1=BB=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=202=E3=80=81=E5=AE=8C=E5=96=84=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=203=E3=80=81=E5=BA=95=E5=B1=82=E6=A1=86?= =?UTF-8?q?=E6=9E=B6=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E6=8F=90=E4=BE=9B=E5=AF=B9=E5=A4=96=E6=89=A9?= =?UTF-8?q?=E5=B1=95=E6=8E=A5=E5=8F=A3=204=E3=80=81=E5=AE=8C=E5=96=84=20De?= =?UTF-8?q?mo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/src/main/java/me/mvp/demo/mvp/main/MainActivity.java | 1 + .../main/java/me/mvp/frame/di/module/AppConfigModule.java | 3 +-- .../me/mvp/frame/http/interceptor/NetworkInterceptor.java | 7 +------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/App/src/main/java/me/mvp/demo/mvp/main/MainActivity.java b/App/src/main/java/me/mvp/demo/mvp/main/MainActivity.java index fbd7df0..53c13b3 100644 --- a/App/src/main/java/me/mvp/demo/mvp/main/MainActivity.java +++ b/App/src/main/java/me/mvp/demo/mvp/main/MainActivity.java @@ -1,6 +1,7 @@ package me.mvp.demo.mvp.main; import android.os.Bundle; +import android.os.Handler; import android.support.annotation.NonNull; import android.support.v4.content.ContextCompat; diff --git a/Common/src/main/java/me/mvp/frame/di/module/AppConfigModule.java b/Common/src/main/java/me/mvp/frame/di/module/AppConfigModule.java index 5ea04b1..3363772 100644 --- a/Common/src/main/java/me/mvp/frame/di/module/AppConfigModule.java +++ b/Common/src/main/java/me/mvp/frame/di/module/AppConfigModule.java @@ -190,8 +190,7 @@ public Cache build(CacheType type) { @Provides NetworkInterceptor.Level provideHttpLogLevel() { Logg.init(new LoggConfiguration.Buidler() - .setDebug(httpLogLevel != null - && (httpLogLevel == NetworkInterceptor.Level.ALL || httpLogLevel == NetworkInterceptor.Level.SIMPLE)) + .setDebug(httpLogLevel != null && httpLogLevel == NetworkInterceptor.Level.ALL) .build()); return httpLogLevel == null ? NetworkInterceptor.Level.ALL : httpLogLevel; } diff --git a/Common/src/main/java/me/mvp/frame/http/interceptor/NetworkInterceptor.java b/Common/src/main/java/me/mvp/frame/http/interceptor/NetworkInterceptor.java index 34446e9..f0fcd43 100644 --- a/Common/src/main/java/me/mvp/frame/http/interceptor/NetworkInterceptor.java +++ b/Common/src/main/java/me/mvp/frame/http/interceptor/NetworkInterceptor.java @@ -52,7 +52,6 @@ public class NetworkInterceptor implements Interceptor { public enum Level { NONE,// 不打印任何日志 - SIMPLE,// 只打印关键日志 ALL// 打印全部日志 } @@ -104,8 +103,6 @@ private Request resolveRequestLogger(StringBuilder builder, Chain chain) throws return request; } - boolean hasSimpleLog = level == Level.SIMPLE; - RequestBody requestBody = request.body(); boolean hasRequestBody = requestBody != null; @@ -129,7 +126,7 @@ private Request resolveRequestLogger(StringBuilder builder, Chain chain) throws builder.append(LoggConstant.BR); - if (hasRequestBody && hasSimpleLog) { + if (hasRequestBody) { if (requestBody.contentType() != null) { builder.append("Content-Type: ").append(requestBody.contentType()).append(LoggConstant.BR); } @@ -202,8 +199,6 @@ private Response resolveResponseLogger(StringBuilder builder, Chain chain) throw long tookMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs); - boolean hasSimpleLog = level == Level.SIMPLE; - ResponseBody responseBody = response.body(); boolean hasResponseBody = responseBody != null;