From c146533d3fd35898d7378052a50cf39edd7e5301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E8=8B=B1=E6=9D=B0?= <327782001@qq.com> Date: Sat, 17 Jun 2023 10:29:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=9B=BE=E7=89=87=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kwan/springbootkwan/utils/FileContainsUtil.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/kwan/springbootkwan/utils/FileContainsUtil.java b/src/main/java/com/kwan/springbootkwan/utils/FileContainsUtil.java index 939fbca..c14d2be 100644 --- a/src/main/java/com/kwan/springbootkwan/utils/FileContainsUtil.java +++ b/src/main/java/com/kwan/springbootkwan/utils/FileContainsUtil.java @@ -5,6 +5,7 @@ import cn.hutool.core.date.StopWatch; import com.alibaba.fastjson2.JSON; import com.google.common.base.Charsets; import com.google.common.io.Files; +import lombok.extern.slf4j.Slf4j; import java.io.File; import java.io.IOException; @@ -19,6 +20,7 @@ import java.util.List; * @version : 2.2.0 * @date : 2023/2/8 10:45 */ +@Slf4j public class FileContainsUtil { /** * 默认图片不存在 @@ -52,7 +54,7 @@ public class FileContainsUtil { final List isNotExist = new ArrayList<>(); //获取所有图片名称 final List picNames = getPicName(PIC_PATH); - System.out.println("图片总数为" + picNames.size()); + log.info("图片总数为{}", picNames.size()); if (CollectionUtil.isNotEmpty(picNames)) { outerloop: for (int i = 0; i < picNames.size(); i++) { @@ -78,10 +80,12 @@ public class FileContainsUtil { } } } - System.out.println("不存在图片总数为" + isNotExist.size()); + log.info("不存在图片总数为{}", isNotExist.size()); stopWatch.stop(); //毫秒输出 - System.out.println(JSON.toJSONString(stopWatch.getTaskInfo())); + log.info("耗时统计信息:{}", JSON.toJSONString(stopWatch.getTaskInfo())); + log.info("耗时秒数:{}", JSON.toJSONString(stopWatch.getTotalTimeSeconds())); + log.info("耗时分钟数:{}", JSON.toJSONString(stopWatch.getTotalTimeSeconds() / 60)); } /** -- GitLab