Compare commits

..

No commits in common. "b647b8fae6b2890d2093c02ab578aa0381833d49" and "facb7e7b403e1dfaa8790426259e6effb0618efb" have entirely different histories.

2 changed files with 134 additions and 146 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@hibas123/logging", "name": "@hibas123/logging",
"version": "2.1.5", "version": "2.1.4",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,19 +1,11 @@
import { ObservableInterface } from "@hibas123/utils"; import { ObservableInterface } from "@hibas123/utils";
import { Colors } from "./index"; import { Colors } from "./index";
import { import {
<<<<<<< HEAD
Adapter,
Message,
FormattedLine,
TerminalFormats,
FormatTypes
=======
Adapter, Adapter,
Message, Message,
FormattedLine, FormattedLine,
TerminalFormats, TerminalFormats,
FormatTypes, FormatTypes,
>>>>>>> facb7e7b403e1dfaa8790426259e6effb0618efb
} from "./types"; } from "./types";
const browser = typeof window !== "undefined"; const browser = typeof window !== "undefined";
@ -23,11 +15,7 @@ export class ConsoleAdapter implements Adapter {
observable.subscribe(this.onMessage.bind(this)); observable.subscribe(this.onMessage.bind(this));
} }
<<<<<<< HEAD
flush() {} flush() {}
=======
flush() {}
>>>>>>> facb7e7b403e1dfaa8790426259e6effb0618efb
// TODO: Check if required! // TODO: Check if required!
// private escape(text: string): string { // private escape(text: string): string {
@ -148,16 +136,16 @@ export class ConsoleAdapter implements Adapter {
if (browser) { if (browser) {
let formats: string[] = []; let formats: string[] = [];
let text = lines let text = lines
.map(line => { .map((line) => {
let [t, fmts] = this.formatLine(line); let [t, fmts] = this.formatLine(line);
formats.push(...fmts); formats.push(...fmts);
return prefix + t; return t;
}) })
.join("\n"); .join("\n");
// console.log(formats); // console.log(formats);
console.log(text, ...formats); console.log(text, ...formats);
} else { } else {
lines.forEach(line => { lines.forEach((line) => {
let [text] = this.formatLine(line); let [text] = this.formatLine(line);
console.log(prefix + text); console.log(prefix + text);
}); });