From b1a1ab678300533f2bab2254f0c1ed3ce5e39716 Mon Sep 17 00:00:00 2001 From: Fabian Date: Mon, 29 Apr 2019 14:50:50 -0400 Subject: [PATCH] Fixing bug that caused newline in browser console --- package.json | 2 +- src/consolewriter.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 000837c..b3d07d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hibas123/logging", - "version": "2.0.4", + "version": "2.0.5", "description": "", "main": "out/index.js", "types": "out/index.d.ts", diff --git a/src/consolewriter.ts b/src/consolewriter.ts index a4177ad..791a9cf 100644 --- a/src/consolewriter.ts +++ b/src/consolewriter.ts @@ -128,13 +128,13 @@ export class ConsoleAdapter implements Adapter { if (message.name) prefix = `[${message.name}]=>`; if (browser) { - let text = ""; + let formats: string[] = []; - lines.forEach(line => { + let text = lines.map(line => { let [t, fmts] = this.formatLine(line); - text += t + "\n"; formats.push(...fmts); - }) + return t; + }).join("\n"); // console.log(formats); console.log(text, ...formats); } else {