@youpaichris/logger 6.1.4 → 6.1.5
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +4 -3
- package/package.json +1 -1
package/index.js
CHANGED
@@ -12,7 +12,7 @@ let logFilePath, logFile, successFilePath, successFile, errorFilePath, errorFile
|
|
12
12
|
|
13
13
|
const __log = console.log;
|
14
14
|
const __log__ = function () {
|
15
|
-
if (arguments[3] === '\x1B[41m') {
|
15
|
+
if (arguments[3] === '\x1B[0m\x1B[1m\x1B[41m') {
|
16
16
|
arguments[4] = "\b" + arguments[4];
|
17
17
|
arguments[arguments.length - 1] += consoleStyles['redBG'][1] + consoleStyles['bold'][1] + '\b';
|
18
18
|
}
|
@@ -252,12 +252,13 @@ class Logger {
|
|
252
252
|
};
|
253
253
|
|
254
254
|
critical(...msg) {
|
255
|
+
// \x1B[0m\x1B[41m\x1B[1m
|
255
256
|
this.#prefix && msg.unshift(this.#prefix);
|
256
257
|
let pathLine = this?.path ? `[${this.path}:${__line}]` : "Anonymous";
|
257
258
|
loggerConfig.log(consoleStyles['green'][0] + dateFormat("YYYY-mm-dd HH:MM:SS.ms", new loggerConfig.Date()),
|
258
259
|
consoleStyles['red'][0] + consoleStyles['bold'][0] + "| " +
|
259
|
-
|
260
|
-
consoleStyles['blue'][0], ` ${pathLine.padEnd(22, " ")}${consoleStyles['cyan'][0]}🔴
|
260
|
+
'\x1B[0m' + consoleStyles['bold'][0] + consoleStyles['redBG'][0] + "CRITICAL" + consoleStyles['redBG'][1] + consoleStyles['red'][0] + " |" +
|
261
|
+
consoleStyles['blue'][0], ` ${pathLine.padEnd(22, " ")}${consoleStyles['cyan'][0]}🔴 `, '\x1B[0m' + consoleStyles['bold'][0] + consoleStyles['redBG'][0],
|
261
262
|
...msg,
|
262
263
|
consoleStyles['redBG'][1] + consoleStyles['bold'][1] + '\b', consoleStyles['redBG'][1] + consoleStyles['bold'][1] + '\b'
|
263
264
|
);
|