Fixing bug that caused newline in browser console

This commit is contained in:
Fabian 2019-04-29 14:50:50 -04:00
parent 0c9ff9d018
commit b1a1ab6783
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@hibas123/logging", "name": "@hibas123/logging",
"version": "2.0.4", "version": "2.0.5",
"description": "", "description": "",
"main": "out/index.js", "main": "out/index.js",
"types": "out/index.d.ts", "types": "out/index.d.ts",

View File

@ -128,13 +128,13 @@ export class ConsoleAdapter implements Adapter {
if (message.name) prefix = `[${message.name}]=>`; if (message.name) prefix = `[${message.name}]=>`;
if (browser) { if (browser) {
let text = "";
let formats: string[] = []; let formats: string[] = [];
lines.forEach(line => { let text = lines.map(line => {
let [t, fmts] = this.formatLine(line); let [t, fmts] = this.formatLine(line);
text += t + "\n";
formats.push(...fmts); formats.push(...fmts);
}) return t;
}).join("\n");
// console.log(formats); // console.log(formats);
console.log(text, ...formats); console.log(text, ...formats);
} else { } else {