调整日志格式
This commit is contained in:
parent
e7c97f2b55
commit
94f8ee7f3b
@ -122,11 +122,11 @@ public class AppContext extends CommonAppContext {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
//注册全局异常捕获
|
||||
if (!isMainProcess()) {
|
||||
return;
|
||||
}
|
||||
CrashSaveBean.getInstance().setStartTime(System.currentTimeMillis());
|
||||
//注册全局异常捕获
|
||||
registerError();
|
||||
registerFirebaseCrash();
|
||||
LogUtils.start(this);
|
||||
|
@ -31,7 +31,7 @@ public class LogUtils {
|
||||
String[] exec = new String[]{"logcat", "-c"};
|
||||
Runtime.getRuntime().exec(exec).waitFor();
|
||||
|
||||
exec = new String[]{"logcat", "-v", "UTC", "-D"};
|
||||
exec = new String[]{"logcat", "-v", "color", "UTC-8"};
|
||||
|
||||
Process process = Runtime.getRuntime().exec(exec);
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||
@ -55,6 +55,7 @@ public class LogUtils {
|
||||
writer = new PrintWriter(os);
|
||||
while ((line = bufferedReader.readLine()) != null) {
|
||||
writer.append(line).write("\n");
|
||||
writer.flush();
|
||||
}
|
||||
writer.flush();
|
||||
writer.close();
|
||||
|
Loading…
Reference in New Issue
Block a user