ee-core 2.10.1 → 2.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/log/logger.js +19 -3
  2. package/package.json +1 -1
package/log/logger.js CHANGED
@@ -6,6 +6,11 @@ const Ps = require('../ps');
6
6
  const Conf = require('../config');
7
7
  const ConfigCache = require('../config/cache');
8
8
  let LogDate = 0;
9
+ const TmpFileName = {
10
+ appLogName: '',
11
+ coreLogName: '',
12
+ errorLogName: '',
13
+ }
9
14
 
10
15
  module.exports = {
11
16
 
@@ -73,9 +78,20 @@ module.exports = {
73
78
  let now = parseInt(dayjs().format('YYYYMMDD'));
74
79
  if (LogDate != now) {
75
80
  LogDate = now;
76
- let appLogName = logOpt.logger.appLogName;
77
- let coreLogName = logOpt.logger.coreLogName;
78
- let errorLogName = logOpt.logger.errorLogName;
81
+
82
+ // 保存一个临时文件名,防止文件名按日期累加
83
+ if (TmpFileName.appLogName.length == 0) {
84
+ TmpFileName.appLogName = logOpt.logger.appLogName;
85
+ }
86
+ if (TmpFileName.coreLogName.length == 0) {
87
+ TmpFileName.coreLogName = logOpt.logger.coreLogName;
88
+ }
89
+ if (TmpFileName.errorLogName.length == 0) {
90
+ TmpFileName.errorLogName = logOpt.logger.errorLogName;
91
+ }
92
+ let appLogName = TmpFileName.appLogName;
93
+ let coreLogName = TmpFileName.coreLogName;
94
+ let errorLogName = TmpFileName.errorLogName;
79
95
  let appLogExtname = path.extname(appLogName);
80
96
  let coreLogExtname = path.extname(coreLogName);
81
97
  let errorLogExtname = path.extname(errorLogName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ee-core",
3
- "version": "2.10.1",
3
+ "version": "2.10.2",
4
4
  "description": "ee core",
5
5
  "main": "index.js",
6
6
  "scripts": {