Compare commits
No commits in common. "ce8ecbe8c9decbb78995fb9895e80b1fc4193a8c" and "a3130f8a8967a05240d59bcc7f686e5f438bacee" have entirely different histories.
ce8ecbe8c9
...
a3130f8a89
@ -240,10 +240,10 @@ class LoggingBase {
|
|||||||
let prefix = `[${LoggingTypes[type]}][${file.file}:${file.line}][${date}]: `;
|
let prefix = `[${LoggingTypes[type]}][${file.file}:${file.line}][${date}]: `;
|
||||||
let message_lines = mb.split("\n").map(line => prefix + line);
|
let message_lines = mb.split("\n").map(line => prefix + line);
|
||||||
if (this.config.console_out) {
|
if (this.config.console_out) {
|
||||||
let name = "";
|
let prefix = "";
|
||||||
if (this.config.name)
|
if (this.config.name)
|
||||||
name = `[${this.config.name}]`;
|
prefix = `[${this.config.name}]`;
|
||||||
message_lines.forEach(line => console.log(consoleLogFormat + name + line + exports.Colors.Reset));
|
message_lines.forEach(line => console.log(consoleLogFormat + prefix + line + exports.Colors.Reset));
|
||||||
}
|
}
|
||||||
let m = message_lines.join("\n");
|
let m = message_lines.join("\n");
|
||||||
m = m.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, "");
|
m = m.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, "");
|
||||||
@ -259,7 +259,7 @@ class LoggingBase {
|
|||||||
if (this.logFile) {
|
if (this.logFile) {
|
||||||
this.logFile.write(data);
|
this.logFile.write(data);
|
||||||
}
|
}
|
||||||
this.events.emit("message", { type: type, message: m, module: this.config.name });
|
this.events.emit("message", { type: type, message: data.toString("utf8") });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.LoggingBase = LoggingBase;
|
exports.LoggingBase = LoggingBase;
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,11 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "@hibas123/nodelogging",
|
"name": "@hibas123/nodelogging",
|
||||||
"version": "1.3.20",
|
"version": "1.3.19",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "out/index.js",
|
"main": "out/index.js",
|
||||||
"types": "out/index.d.ts",
|
"types": "out/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepublish": "tsc",
|
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"watch": "tsc --watch",
|
"watch": "tsc --watch",
|
||||||
"test": "node out/test.js",
|
"test": "node out/test.js",
|
||||||
|
@ -281,9 +281,9 @@ export class LoggingBase {
|
|||||||
let message_lines = mb.split("\n").map(line => prefix + line);
|
let message_lines = mb.split("\n").map(line => prefix + line);
|
||||||
|
|
||||||
if (this.config.console_out) {
|
if (this.config.console_out) {
|
||||||
let name = "";
|
let prefix = "";
|
||||||
if (this.config.name) name = `[${this.config.name}]`;
|
if (this.config.name) prefix = `[${this.config.name}]`;
|
||||||
message_lines.forEach(line => console.log(consoleLogFormat + name + line + Colors.Reset));
|
message_lines.forEach(line => console.log(consoleLogFormat + prefix + line + Colors.Reset));
|
||||||
}
|
}
|
||||||
|
|
||||||
let m = message_lines.join("\n");
|
let m = message_lines.join("\n");
|
||||||
@ -303,7 +303,7 @@ export class LoggingBase {
|
|||||||
if (this.logFile) {
|
if (this.logFile) {
|
||||||
this.logFile.write(data);
|
this.logFile.write(data);
|
||||||
}
|
}
|
||||||
this.events.emit("message", { type: type, message: m, module: this.config.name });
|
this.events.emit("message", { type: type, message: data.toString("utf8") });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user