diff --git a/app/build.gradle b/app/build.gradle index 0853b8d9..35d831ba 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -63,7 +63,7 @@ dependencies { implementation "com.squareup.okhttp3:okhttp:${okhttp_version}" -// implementation "com.ljx/.rxhttp:rxhttp:${rxhttp_version}" +// implementation "com.ljx.rxhttp:rxhttp:${rxhttp_version}" // kapt "com.ljx.rxhttp:rxhttp-compiler:${rxhttp_version}" implementation 'com.ljx.rxlife:rxlife-coroutine:2.0.1' diff --git a/rxhttp/src/main/java/rxhttp/Platform.java b/rxhttp/src/main/java/rxhttp/Platform.java index 3de38cbb..3f1424fb 100644 --- a/rxhttp/src/main/java/rxhttp/Platform.java +++ b/rxhttp/src/main/java/rxhttp/Platform.java @@ -93,26 +93,16 @@ public void logd(String tag, String message, Throwable e) { public static void log(int priority, String tag, String content) { int p = 3072; - int length = content.length(); - boolean isBlockPrint = LogUtil.isSegmentPrint(); - if (length <= p || !isBlockPrint) { - Log.println(priority, tag, content); - if (length > p) { - String tip = "Because of the logcat log printing limit, " + (length - p) + " bytes are omitted this time. " + - "If you want to print all the logs, call 'RxHttp.setDebug(true, true)' to turn on segment printing"; - Log.w(tag, tip); - } - } else { - int i = 0; - while (content.length() > p) { - String logContent = content.substring(0, p); - Log.println(priority, tag, logContent); - Log.println(priority, tag, "<---------------------------------- Segment " + (++i) + " ---------------------------------->"); - content = content.substring(p); - } - if (content.length() > 0) - Log.println(priority, tag, content); + int i = 0; + while (content.length() > p) { + String logContent = content.substring(0, p); + Log.println(priority, tag, logContent); + if (!LogUtil.isSegmentPrint()) return; + Log.i(tag, "<---------------------------------- Segment " + (++i) + " ---------------------------------->"); + content = content.substring(p); } + if (content.length() > 0) + Log.println(priority, tag, content); } } }