From 331169c925b6f4ce05e2b7341f269b2ba8f3f081 Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Tue, 19 Mar 2019 21:47:21 +0100 Subject: [PATCH] Improving Logging output. --- src/index.ts | 4 ++-- src/test.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2a15bb2..98ee8b5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -277,12 +277,12 @@ export class LoggingBase { } let file = caller || getCallerFile(); let date = new Date().toISOString().replace(/T/, ' ').replace(/\..+/, ''); - let prefix = `[${LoggingTypes[type]}][${file.file}:${file.line}][${date}]: `; + let prefix = `[ ${date} ][${LoggingTypes[type].toUpperCase()}][${file.file}:${String(file.line).padEnd(3, " ")}]: `; let message_lines = mb.split("\n").map(line => prefix + line); if (this.config.console_out) { let name = ""; - if (this.config.name) name = `[${this.config.name}]`; + if (this.config.name) name = `[${this.config.name}]=>`; message_lines.forEach(line => console.log(consoleLogFormat + name + line + Colors.Reset)); } diff --git a/src/test.ts b/src/test.ts index 2e3c9d1..7fa9626 100644 --- a/src/test.ts +++ b/src/test.ts @@ -47,6 +47,7 @@ async function benchmark(count: number, message_size: number) { } Logging.waitForSetup().then(async () => { + return; console.log("Large data benchmark:") await benchmark(7000, 50000);