1
0
mirror of https://git.stamm.me/OpenServer/NodeLogging.git synced 2024-09-28 02:17:07 +00:00

Fixing not complete color code removal

This commit is contained in:
hibas123 2018-04-09 20:02:34 +02:00
parent e4ea3f660c
commit df39c423fe
6 changed files with 8 additions and 4 deletions

View File

@ -102,7 +102,7 @@ class Logging {
console.log(consoleLogFormat + m + Reset); console.log(consoleLogFormat + m + Reset);
let index = m.indexOf("\x1b"); let index = m.indexOf("\x1b");
while (index >= 0) { while (index >= 0) {
m = m.substring(0, index) + m.substring(index + 4, m.length); m = m.substring(0, index) + m.substring(index + 5, m.length);
index = m.indexOf("\x1b"); index = m.indexOf("\x1b");
} }
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, "");

File diff suppressed because one or more lines are too long

View File

@ -7,6 +7,7 @@ index_1.Logging.log("i", "am", { a: "an" }, 1000);
index_1.Logging.error(new Error("fehler 001")); index_1.Logging.error(new Error("fehler 001"));
index_1.Logging.debug("Some Debug infos"); index_1.Logging.debug("Some Debug infos");
index_1.Logging.errorMessage("i", "am", "an", "error"); index_1.Logging.errorMessage("i", "am", "an", "error");
index_1.Logging.log("\x1b[31m\x1b[31m\x1b[31m\x1b[31m\x1b[31m\x1b[31m TEST \x1b[31m\x1b[31m\x1b[31m");
index_1.Logging.stdout = false; index_1.Logging.stdout = false;
for (let i = 0; i < 7000; i++) { for (let i = 0; i < 7000; i++) {
index_1.Logging.log(crypto_1.randomBytes(50000).toString("hex")); index_1.Logging.log(crypto_1.randomBytes(50000).toString("hex"));

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":";;AAAA,mCAAkC;AAClC,mCAAqC;AAErC,eAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CA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B,eAAO,CAAC,GAAG,CAAC,oBAAW,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;AAClD,CAAC"}

View File

@ -122,7 +122,7 @@ export class Logging {
let index = m.indexOf("\x1b"); let index = m.indexOf("\x1b");
while (index >= 0) { while (index >= 0) {
m = m.substring(0, index) + m.substring(index + 4, m.length); m = m.substring(0, index) + m.substring(index + 5, m.length);
index = m.indexOf("\x1b"); index = m.indexOf("\x1b");
} }

View File

@ -6,6 +6,9 @@ Logging.log("i", "am", { a: "an" }, 1000);
Logging.error(new Error("fehler 001")); Logging.error(new Error("fehler 001"));
Logging.debug("Some Debug infos"); Logging.debug("Some Debug infos");
Logging.errorMessage("i", "am", "an", "error"); Logging.errorMessage("i", "am", "an", "error");
Logging.log("\x1b[31m\x1b[31m\x1b[31m\x1b[31m\x1b[31m\x1b[31m TEST \x1b[31m\x1b[31m\x1b[31m")
Logging.stdout = false; Logging.stdout = false;
for (let i = 0; i < 7000; i++) { for (let i = 0; i < 7000; i++) {
Logging.log(randomBytes(50000).toString("hex")) Logging.log(randomBytes(50000).toString("hex"))