Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing handleRejections in logger options #1847

Closed
wants to merge 1 commit into from

Conversation

t-moennich
Copy link

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

Fixes #1801

@sevetseh28
Copy link

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

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

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

@unconfident
Copy link

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
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