ts-composite-logger
Advanced tools
Comparing version 1.0.8 to 1.0.9
11
index.ts
@@ -24,10 +24,12 @@ import LogCode from "./constants/LogCode"; | ||
public addChannel(channel: ILoggerChannel): void { | ||
public addChannel(channel: ILoggerChannel): Logger { | ||
this.channels.push(channel); | ||
return this; | ||
} | ||
public removeChannel(name: string): ILoggerChannel[] { | ||
public removeChannel(name: string): Logger { | ||
for (const i in this.channels) { | ||
if (this.channels[i].constructor.name === name) { | ||
return this.channels.splice(parseInt(i), 1); | ||
this.channels.splice(parseInt(i), 1); | ||
return this; | ||
} | ||
@@ -39,3 +41,3 @@ } | ||
public setLevel(level: string): void { | ||
public setLevel(level: string): Logger { | ||
if (!Object.values(LogLevel).includes(level)) { | ||
@@ -46,2 +48,3 @@ throw new Error(`Unexpected log level: ${level}`); | ||
this.level = level; | ||
return this; | ||
} | ||
@@ -48,0 +51,0 @@ |
{ | ||
"name": "ts-composite-logger", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "Logger written in typescript. Includes a console channel by default. Allows to add other log channels by extending ILogChannel interface.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21420
455