ts-composite-logger
Advanced tools
Comparing version 1.0.9 to 1.0.10
import { ILoggerChannel } from "./interfaces/ILoggerChannel"; | ||
import { ILoggerPayload } from "./interfaces/ILoggerPayload"; | ||
export { Console } from "./Console"; | ||
export { LogLevel } from "./constants/LogLevel"; | ||
export { ILoggerChannel } from "./interfaces/ILoggerChannel"; | ||
export { ILoggerPayload } from "./interfaces/ILoggerPayload"; | ||
export { ILogMessage } from "./interfaces/ILogMessage"; | ||
export declare class Logger { | ||
@@ -8,5 +12,5 @@ private readonly channels; | ||
constructor(); | ||
addChannel(channel: ILoggerChannel): void; | ||
removeChannel(name: string): ILoggerChannel[]; | ||
setLevel(level: string): void; | ||
addChannel(channel: ILoggerChannel): Logger; | ||
removeChannel(name: string): Logger; | ||
setLevel(level: string): Logger; | ||
error(message: string, code?: number, object?: ILoggerPayload): Promise<any>; | ||
@@ -13,0 +17,0 @@ fatal(message: string, code?: number, object?: ILoggerPayload, callback?: Function): Promise<any>; |
@@ -21,2 +21,4 @@ "use strict"; | ||
exports.Console = Console_1.Console; | ||
var LogLevel_2 = require("./constants/LogLevel"); | ||
exports.LogLevel = LogLevel_2.LogLevel; | ||
class Logger { | ||
@@ -29,2 +31,3 @@ constructor() { | ||
this.channels.push(channel); | ||
return this; | ||
} | ||
@@ -34,3 +37,4 @@ removeChannel(name) { | ||
if (this.channels[i].constructor.name === name) { | ||
return this.channels.splice(parseInt(i), 1); | ||
this.channels.splice(parseInt(i), 1); | ||
return this; | ||
} | ||
@@ -45,2 +49,3 @@ } | ||
this.level = level; | ||
return this; | ||
} | ||
@@ -47,0 +52,0 @@ error(message, code = LogCode_1.default.GENERAL_ERROR, object = {}) { |
{ | ||
"name": "ts-composite-logger", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"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", |
Sorry, the diff of this file is not supported yet
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
21891
464