From 8dec9e6d03c15189cc4363856e287968db92c2d4 Mon Sep 17 00:00:00 2001 From: Stamm Date: Fri, 5 Apr 2019 09:05:35 -0400 Subject: [PATCH] Exporting ConsoleAdapter --- package-lock.json | 30 ++++++++++++++++++++++-------- package.json | 8 +++++++- src/base.ts | 4 ++-- src/consolewriter.ts | 2 +- src/index.ts | 2 +- 5 files changed, 33 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4cab298..d6b0e60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@hibas123/logging", - "version": "2.0.0", + "version": "2.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -816,12 +816,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -836,17 +838,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -963,7 +968,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -975,6 +981,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -989,6 +996,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -996,12 +1004,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -1020,6 +1030,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -1100,7 +1111,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -1112,6 +1124,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -1233,6 +1246,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/package.json b/package.json index 4c11fc3..b64fd22 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hibas123/logging", - "version": "2.0.1", + "version": "2.0.3", "description": "", "main": "out/index.js", "types": "out/index.d.ts", @@ -18,6 +18,12 @@ }, "author": "Fabian Stamm", "license": "MIT", + "files": [ + "src/", + "out/", + "tsconfig.json", + "readme.md" + ], "devDependencies": { "concurrently": "^4.1.0", "nodemon": "^1.18.10", diff --git a/src/base.ts b/src/base.ts index 335f265..5726d08 100644 --- a/src/base.ts +++ b/src/base.ts @@ -1,5 +1,5 @@ import { Observable } from "@hibas123/utils"; -import { ConsoleWriter } from "./consolewriter"; +import { ConsoleAdapter } from "./consolewriter"; import inspect from "./inspect"; import { Adapter, LoggingTypes, Message, FormatConfig, DefaultFormatConfig, Format, FormatTypes, Colors, FormattedText, FormattedLine } from "./types"; @@ -68,7 +68,7 @@ export class LoggingBase { } if (config.console) { - this.addAdapter(new ConsoleWriter()); + this.addAdapter(new ConsoleAdapter()); } } diff --git a/src/consolewriter.ts b/src/consolewriter.ts index ec308d9..4729c8e 100644 --- a/src/consolewriter.ts +++ b/src/consolewriter.ts @@ -4,7 +4,7 @@ import { Adapter, Message, FormattedLine, TerminalFormats, FormatTypes } from ". const browser = typeof window !== "undefined"; -export class ConsoleWriter implements Adapter { +export class ConsoleAdapter implements Adapter { init(observable: ObservableInterface) { observable.subscribe(this.onMessage.bind(this)); } diff --git a/src/index.ts b/src/index.ts index 9eeec20..e129a5f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ import { LoggingBase } from "./base"; - +export { ConsoleAdapter } from "./consolewriter"; export { LoggingBase, LoggingBaseOptions, removeColors } from "./base"; export { Adapter,