Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ declare namespace winston {
exitOnError?: Function | boolean;
defaultMeta?: any;
transports?: Transport[] | Transport;
handleExceptions?: boolean;
handleRejections?: boolean;
exceptionHandlers?: any;
rejectionHandlers?: any;
}
Expand Down
15 changes: 15 additions & 0 deletions test/typescript-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,18 @@ logger.isInfoEnabled();
logger.isVerboseEnabled();
logger.isDebugEnabled();
logger.isSillyEnabled();

// `handleExceptions` / `handleRejections` are transport options, not logger
// options: `Logger#configure` never reads them off the options object, so
// accepting them here silently did nothing. They belong on a transport.
winston.createLogger({
transports: [
new winston.transports.Console({ handleExceptions: true, handleRejections: true }),
],
});

// @ts-expect-error handleExceptions is not a LoggerOptions field
winston.createLogger({ handleExceptions: true });

// @ts-expect-error handleRejections is not a LoggerOptions field
winston.createLogger({ handleRejections: true });