diff --git a/src/main/java/com/kwan/springbootkwan/utils/FileContainsUtil.java b/src/main/java/com/kwan/springbootkwan/utils/FileContainsUtil.java index 939fbca0c4712524cf3a8cf14e801d05d89255d5..c14d2bef416f3d3f4c656e6c0683cb8bd7a8325d 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)); } /**