diff --git a/app/src/main/java/com/shayu/phonelive/utils/LogUtils.java b/app/src/main/java/com/shayu/phonelive/utils/LogUtils.java index 6138f8967..37cbf1015 100644 --- a/app/src/main/java/com/shayu/phonelive/utils/LogUtils.java +++ b/app/src/main/java/com/shayu/phonelive/utils/LogUtils.java @@ -31,7 +31,7 @@ public class LogUtils { String[] exec = new String[]{"logcat", "-c"}; Runtime.getRuntime().exec(exec).waitFor(); - exec = new String[]{"logcat", "-v", "color", "-D"}; + exec = new String[]{"logcat", "-v", "UTC", "-D"}; Process process = Runtime.getRuntime().exec(exec); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream())); @@ -42,7 +42,7 @@ public class LogUtils { File dir = new File(context.getDir("files", Context.MODE_PRIVATE).getAbsolutePath() + File.separator); if (dir.listFiles() != null) { for (File file : dir.listFiles()) { - if (!file.getName().endsWith(today + ".log") && !"error.log".equals(file.getName())) { + if (!file.getName().endsWith(".log") && !"error.log".equals(file.getName())) { String fileName = file.getName().replace(title, ""); if (isDelLog(fileName)) { file.delete(); @@ -51,7 +51,7 @@ public class LogUtils { } } File saveFile = new File(context.getDir("files", Context.MODE_PRIVATE).getAbsolutePath() + File.separator + today + ".log"); - FileOutputStream os = new FileOutputStream(saveFile); + FileOutputStream os = new FileOutputStream(saveFile,true); writer = new PrintWriter(os); while ((line = bufferedReader.readLine()) != null) { writer.append(line).write("\n");