From fbb55fa1584201f7ece429e24e934fef7e87bf23 Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Tue, 19 Mar 2019 21:49:25 +0100 Subject: [PATCH] Improving Logging output. --- package.json | 2 +- src/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d0af365..3e13e50 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hibas123/nodelogging", - "version": "1.3.21", + "version": "1.4.0", "description": "", "main": "out/index.js", "types": "out/index.d.ts", 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)); }