Browse Source

优化日志获取

hl 7 tháng trước cách đây
mục cha
commit
fb6a8721b8
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/utils/file.js

+ 1 - 1
src/utils/file.js

@@ -160,7 +160,7 @@ async function readLastNLines(dirPath, filePathList, n) {
         // return lastNLines.split("\n").reverse();
 
         const allFile = [].concat(...fileList.map((item) => item.lines));
-        const lastNLines = allFile.slice(-n);
+        const lastNLines = allFile.slice(-n).reverse();
         return lastNLines;
     } catch (e) {
         logger.info('获取日志异常了~~1111111111111111', e);