Allow LoggerInstance.remove to take string

This commit is contained in:
Tony Luo
2018-02-04 21:46:26 -08:00
parent 8058968995
commit 5f0dc4e46d
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -223,7 +223,7 @@ declare namespace winston {
unhandleExceptions(...transports: TransportInstance[]): void;
add(transport: TransportInstance, options?: TransportOptions, created?: boolean): LoggerInstance;
clear(): void;
remove(transport: TransportInstance): LoggerInstance;
remove(transport: string | TransportInstance): LoggerInstance;
startTimer(): ProfileHandler;
profile(id: string, msg?: string, meta?: any, callback?: (err: Error, level: string, msg: string, meta: any) => void): LoggerInstance;
configure(options: LoggerOptions): void;
+3
View File
@@ -260,6 +260,9 @@ logger = new (winston.Logger)({
]
});
/* Remove transport by name */
logger = logger.remove('nooo');
/* Reconfigure logger */
logger.configure({ level: 'silly' });