Przeglądaj źródła

修复bug ,日志查看bug

hl 11 miesięcy temu
rodzic
commit
97e224cfe8
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      src/utils/file.js

+ 2 - 1
src/utils/file.js

@@ -100,7 +100,7 @@ function getLastFile(dirPath, number, callback) {
         for (file of files) {
         for (file of files) {
             const filePath = path.join(dirPath, file);
             const filePath = path.join(dirPath, file);
             const stats = await fs.promises.stat(filePath);
             const stats = await fs.promises.stat(filePath);
-            fileList.push({ name: file, time: stats.mtimeMs });
+            fileList.push({name: file, time: stats.mtimeMs});
         }
         }
         fileList.sort((a, b) => b.time - a.time);
         fileList.sort((a, b) => b.time - a.time);
         lastFileList = fileList.slice(0, number != -1 ? number : fileList.length);
         lastFileList = fileList.slice(0, number != -1 ? number : fileList.length);
@@ -112,6 +112,7 @@ function getLastFile(dirPath, number, callback) {
 // 读取日志(倒叙)指定行数
 // 读取日志(倒叙)指定行数
 function readLastNLines(dirPath, filePathList, n) {
 function readLastNLines(dirPath, filePathList, n) {
     const fileList = filePathList.map((item) => {
     const fileList = filePathList.map((item) => {
+        logger.info("日志文件:" + dirPath + "/" + item)
         const content = fs.readFileSync(`${dirPath}/${item}`, "utf8");
         const content = fs.readFileSync(`${dirPath}/${item}`, "utf8");
         const lines = content.trim().split("\n");
         const lines = content.trim().split("\n");
         return {
         return {