@youpaichris/logger 6.0.8 → 6.1.0
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.
- package/index.js +5 -3
- package/package.json +1 -1
package/index.js
CHANGED
@@ -5,7 +5,6 @@
|
|
5
5
|
* Chris / QQ:10512
|
6
6
|
*/
|
7
7
|
|
8
|
-
const fs = require('fs');
|
9
8
|
const {createWriteStreamWithDirectories} = require('./utils.js');
|
10
9
|
|
11
10
|
let logFilePath, logFile, successFilePath, successFile, errorFilePath, errorFile, criticalFilePath, criticalFile;
|
@@ -259,8 +258,8 @@ class Logger {
|
|
259
258
|
consoleStyles['red'][0] + consoleStyles['bold'][0] + "| " +
|
260
259
|
consoleStyles['bold'][0] + consoleStyles['redBG'][0] + consoleStyles['white'][0] + "CRITICAL" + consoleStyles['redBG'][1] + consoleStyles['red'][0] + " |" +
|
261
260
|
consoleStyles['blue'][0], ` ${pathLine.padEnd(22, " ")}${consoleStyles['cyan'][0]}🔴 ${consoleStyles['white'][0]}`, consoleStyles['redBG'][0],
|
262
|
-
...msg
|
263
|
-
|
261
|
+
...msg,
|
262
|
+
consoleStyles['redBG'][1] + consoleStyles['bold'][1] + '\b', consoleStyles['redBG'][1] + consoleStyles['bold'][1] + '\b'
|
264
263
|
);
|
265
264
|
if (this.save) {
|
266
265
|
let _msg = `${dateFormat("YYYY-mm-dd HH:MM:SS.ms", new loggerConfig.Date())} | CRITICAL| ${pathLine.padEnd(22, " ")}${[...msg]}` + '\n';
|
@@ -291,6 +290,9 @@ class Logger {
|
|
291
290
|
*/
|
292
291
|
process.on('exit', () => {
|
293
292
|
logFile?.end();
|
293
|
+
successFile?.end();
|
294
|
+
errorFile?.end();
|
295
|
+
criticalFile?.end();
|
294
296
|
});
|
295
297
|
module.exports = Logger;
|
296
298
|
|