Skip to content

Add missing handleRejections in logger options#1847

Closed
t-moennich wants to merge 1 commit intowinstonjs:masterfrom
t-moennich:patch-1
Closed

Add missing handleRejections in logger options#1847
t-moennich wants to merge 1 commit intowinstonjs:masterfrom
t-moennich:patch-1

Conversation

@t-moennich
Copy link
Copy Markdown

In the future this should extend from a subset of TransportStream in https://github.com/winstonjs/winston-transport/blob/master/index.d.ts

@t-moennich t-moennich changed the title Add mising handleRejections in logger options Add missing handleRejections in logger options Sep 22, 2020
@leonardehrenfried
Copy link
Copy Markdown

Fixes #1801

@sevetseh28
Copy link
Copy Markdown

sevetseh28 commented Nov 19, 2020

Can someone please merge this PR urgently? It's quite an important and core feature to be able to log uncaught exceptions.

@demensky

@unconfident
Copy link
Copy Markdown

unconfident commented Feb 24, 2021

The proposed changes are incomplete, rejections key on Logger still remain undocumented.
RejectionHandler type needs to be defined and rejections: RejectionHandler; added after line 96

winston/index.d.ts

Lines 90 to 99 in 7d0466f

interface Logger extends NodeJSStream.Transform {
silent: boolean;
format: logform.Format;
levels: Config.AbstractConfigSetLevels;
level: string;
transports: Transport[];
exceptions: ExceptionHandler;
profilers: object;
exitOnError: Function | boolean;
defaultMeta?: any;

Public API for RejectionHandler is the same as that of ExceptionHandler, so copy-pasting interface ExceptionHandler with a different name should do.

upd: Just noticed that pull request #1842 introduces these exact changes

@yahyaest
Copy link
Copy Markdown

are handleRejections and rejectionHandlers added in LoggerOptions in the lastet winston version ?

@unconfident
Copy link
Copy Markdown

are handleRejections and rejectionHandlers added in LoggerOptions in the lastet winston version ?

No. Latest version was published on June last year - winston@3.3.3 and winston-transport@4.4.0. In both packages only properties related to unhandled exceptions are documented.

@DABH
Copy link
Copy Markdown
Contributor

DABH commented Jan 13, 2022

This should be solved via #2021 and go out in the next release. Thanks!

@DABH DABH closed this Jan 13, 2022
@wbt wbt mentioned this pull request Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants