Removing conole Color symbols in Logfiles
This commit is contained in:
parent
82cff60b68
commit
0fd6efac99
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "logger-perfcloud",
|
"name": "logger-perfcloud",
|
||||||
"version": "1.0.8",
|
"version": "1.0.9",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "out/index.js",
|
"main": "out/index.js",
|
||||||
"types": "out/index.d.ts",
|
"types": "out/index.d.ts",
|
||||||
|
@ -114,6 +114,14 @@ export class Logging {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var m = "[" + LoggingTypes[type] + "][" + _getCallerFile() + "][" + new Date().toISOString().replace(/T/, ' ').replace(/\..+/, '') + "]: " + mb;
|
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.logFileLocation) {
|
||||||
if (!this.fileStream || !this.errorStream) {
|
if (!this.fileStream || !this.errorStream) {
|
||||||
await Logging.initializeFile();
|
await Logging.initializeFile();
|
||||||
@ -121,7 +129,6 @@ export class Logging {
|
|||||||
Logging.writeMessageToFile(m, type === LoggingTypes.Error);
|
Logging.writeMessageToFile(m, type === LoggingTypes.Error);
|
||||||
}
|
}
|
||||||
Logging.events.emit("message", { type: type, message: mb });
|
Logging.events.emit("message", { type: type, message: mb });
|
||||||
if (this.stdout) console.log(consoleLogFormat + m + Reset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static writeMessageToFile(message: string, error?: boolean) {
|
private static writeMessageToFile(message: string, error?: boolean) {
|
||||||
|
Loading…
Reference in New Issue
Block a user