Compare commits
2 Commits
facb7e7b40
...
b647b8fae6
Author | SHA1 | Date | |
---|---|---|---|
|
b647b8fae6 | ||
|
ce9742a20e |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hibas123/logging",
|
||||
"version": "2.1.4",
|
||||
"version": "2.1.5",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,11 +1,19 @@
|
||||
import { ObservableInterface } from "@hibas123/utils";
|
||||
import { Colors } from "./index";
|
||||
import {
|
||||
<<<<<<< HEAD
|
||||
Adapter,
|
||||
Message,
|
||||
FormattedLine,
|
||||
TerminalFormats,
|
||||
FormatTypes
|
||||
=======
|
||||
Adapter,
|
||||
Message,
|
||||
FormattedLine,
|
||||
TerminalFormats,
|
||||
FormatTypes,
|
||||
>>>>>>> facb7e7b403e1dfaa8790426259e6effb0618efb
|
||||
} from "./types";
|
||||
|
||||
const browser = typeof window !== "undefined";
|
||||
@ -15,7 +23,11 @@ export class ConsoleAdapter implements Adapter {
|
||||
observable.subscribe(this.onMessage.bind(this));
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
flush() {}
|
||||
=======
|
||||
flush() {}
|
||||
>>>>>>> facb7e7b403e1dfaa8790426259e6effb0618efb
|
||||
|
||||
// TODO: Check if required!
|
||||
// private escape(text: string): string {
|
||||
@ -136,16 +148,16 @@ export class ConsoleAdapter implements Adapter {
|
||||
if (browser) {
|
||||
let formats: string[] = [];
|
||||
let text = lines
|
||||
.map((line) => {
|
||||
.map(line => {
|
||||
let [t, fmts] = this.formatLine(line);
|
||||
formats.push(...fmts);
|
||||
return t;
|
||||
return prefix + t;
|
||||
})
|
||||
.join("\n");
|
||||
// console.log(formats);
|
||||
console.log(text, ...formats);
|
||||
} else {
|
||||
lines.forEach((line) => {
|
||||
lines.forEach(line => {
|
||||
let [text] = this.formatLine(line);
|
||||
console.log(prefix + text);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user