1
0
mirror of https://git.stamm.me/OpenServer/NodeLogging.git synced 2024-11-14 22:51:03 +00:00

Adding comilation for latest change

This commit is contained in:
Fabian Stamm 2017-11-04 23:59:56 +01:00
parent 0fd6efac99
commit 5aaa4f6961
3 changed files with 9 additions and 4 deletions

View File

@ -97,6 +97,13 @@ class Logging {
});
}
var m = "[" + LoggingTypes[type] + "][" + _getCallerFile() + "][" + new Date().toISOString().replace(/T/, ' ').replace(/\..+/, '') + "]: " + mb;
if (this.stdout)
console.log(consoleLogFormat + m + Reset);
let index = m.indexOf("\x1b");
while (index >= 0) {
m = m.substring(0, index) + m.substring(index + 4, m.length);
index = m.indexOf("\x1b");
}
if (this.logFileLocation) {
if (!this.fileStream || !this.errorStream) {
await Logging.initializeFile();
@ -104,8 +111,6 @@ class Logging {
Logging.writeMessageToFile(m, type === LoggingTypes.Error);
}
Logging.events.emit("message", { type: type, message: mb });
if (this.stdout)
console.log(consoleLogFormat + m + Reset);
}
static writeMessageToFile(message, error) {
Logging.queue.push({ message: message.replace("\n", " "), error: error });

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "logger-perfcloud",
"version": "1.0.9",
"version": "1.0.10",
"description": "",
"main": "out/index.js",
"types": "out/index.d.ts",