Commit b65e407c by 郭倩芳

net 打印日志内存溢出

parent 64f2643e
......@@ -12,7 +12,7 @@ task androidSourcesJar(type: Jar) {
ext {
PUBLISH_GROUP_ID = "com.sobot.library" //项目包名
PUBLISH_ARTIFACT_ID = 'net' //项目名
PUBLISH_VERSION = '1.2.5' //版本号
PUBLISH_VERSION = '1.2.6' //版本号
}
......
......@@ -98,9 +98,10 @@ public class SobotNetLogUtils {
//分段打印日志每次最大长度
private static final int MAX_LENGTH = 3 * 1024;
public static void i(String content) {
public static void i(String str) {
if (isDebug && allowI) {
String tag = generateTag();
StringBuilder content = new StringBuilder(str);
//采取分段打印日志的方法:当长度超过4000时,我们就来分段截取打印
if (content.length() > MAX_LENGTH) {
String part = content.substring(0, MAX_LENGTH);
......@@ -114,7 +115,7 @@ public class SobotNetLogUtils {
}
} else {
//直接打印
Log.i(tag, content);
Log.i(tag, str);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment