From 5f0dc4e46ddb26d5c2c4bab48c685c6f061330a7 Mon Sep 17 00:00:00 2001 From: Tony Luo Date: Sun, 4 Feb 2018 21:46:26 -0800 Subject: [PATCH] Allow LoggerInstance.remove to take string --- types/winston/index.d.ts | 2 +- types/winston/winston-tests.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/winston/index.d.ts b/types/winston/index.d.ts index 3de43e4349..df360f1e01 100644 --- a/types/winston/index.d.ts +++ b/types/winston/index.d.ts @@ -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; diff --git a/types/winston/winston-tests.ts b/types/winston/winston-tests.ts index a0620c94e0..c9c8fcd0da 100644 --- a/types/winston/winston-tests.ts +++ b/types/winston/winston-tests.ts @@ -260,6 +260,9 @@ logger = new (winston.Logger)({ ] }); +/* Remove transport by name */ +logger = logger.remove('nooo'); + /* Reconfigure logger */ logger.configure({ level: 'silly' });