From e52ec4a2b82a0ca6d9881d26e5f2fcd4e0c723dc Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Sat, 12 Nov 2022 17:08:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=97=A5=E5=BF=97=E6=94=B6?= =?UTF-8?q?=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/shayu/phonelive/utils/LogUtils.java | 2 +- common/src/main/java/com/yunbao/common/utils/LogUtil.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 6aa7404d1..87c8f3124 100644 --- a/app/src/main/java/com/shayu/phonelive/utils/LogUtils.java +++ b/app/src/main/java/com/shayu/phonelive/utils/LogUtils.java @@ -43,7 +43,7 @@ public class LogUtils { if (dir.listFiles() != null) { for (File file : dir.listFiles()) { if (file.getName().endsWith(".log") && !"error.log".equals(file.getName())) { - String fileName = file.getName().replace(title, "").replace(".log", ""); + String fileName = file.getName().replace(".log", "").split("_")[1]; if (isDelLog(fileName)) { file.delete(); } diff --git a/common/src/main/java/com/yunbao/common/utils/LogUtil.java b/common/src/main/java/com/yunbao/common/utils/LogUtil.java index 47c4c8ea7..5b2408cb8 100644 --- a/common/src/main/java/com/yunbao/common/utils/LogUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/LogUtil.java @@ -165,7 +165,7 @@ public class LogUtil { WritableByteChannel writableByteChannel = Channels.newChannel(zos); if (dir.listFiles() != null) { for (File file : dir.listFiles()) { - if (file.getName().endsWith(".log") && !"error.log".equals(file.getName())) { + if (file.getName().endsWith(".log")) { ZipEntry entry = new ZipEntry(file.getName()); zos.putNextEntry(entry); fis = new FileInputStream(file);