Improving Logging output.

This commit is contained in:
Fabian Stamm 2019-03-19 21:47:21 +01:00
parent 0f3dc07dff
commit 331169c925
2 changed files with 3 additions and 2 deletions

View File

@ -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));
}

View File

@ -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);