补充异常日志内容

This commit is contained in:
zlzw 2022-10-22 15:59:00 +08:00
parent ed97955d90
commit a82d3984fa

View File

@ -2,6 +2,7 @@ package com.shayu.phonelive;
import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
@ -13,6 +14,7 @@ import com.yunbao.common.utils.SpUtil;
import java.io.File;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Arrays;
/**
* @ClassName NeverCrashUtils
@ -128,11 +130,13 @@ public class NeverCrashUtils {
}
private static String throwableToString(Throwable e) {
StringWriter writer=new StringWriter();
writer.write("time="+System.currentTimeMillis());
writer.write("\n");
writer.write("UserData=");
writer.write(SpUtil.getInstance().getStringValue(SpUtil.USER_INFO));
writer.write("\n");
writer.write("time="+System.currentTimeMillis()+"\n");
writer.write("AndroidVersion="+ Build.VERSION.SDK_INT+"\n");
writer.write("AndroidName="+ Build.VERSION.RELEASE+"\n");
writer.write("PhoneName="+ Build.BRAND+"\n");
writer.write("Phone="+ Build.MODEL+"\n");
writer.write("CPU="+ Arrays.toString(Build.SUPPORTED_ABIS) +"\n");
writer.write("UserData="+SpUtil.getInstance().getStringValue(SpUtil.USER_INFO)+"\n");
writer.write("[ERROR]");
PrintWriter printWriter=new PrintWriter(writer);
e.printStackTrace(printWriter);