Skip to content

rejections property missing from types #1928

@svaj

Description

@svaj

Please tell us about your environment:

winston version? 3.2.1
    winston@2
    winston@3
node -v outputs: v14.15.4
Operating System? (Windows, macOS, or Linux) macOS
Language? (all | TypeScript X.X | ES6/7 | ES5 | Dart) Typescript 4.3.2

What is the problem?

The rejections property (set at runtime

this.rejections = new RejectionHandler(this);
) is not present in the type definition for Logger
What do you expect to happen instead?

I'd expect the rejections property to be defined as rejections: ExceptionHandler;rejections: RejectionHandler;.
Other information

I ran into this issue while trying to ensure winston's uncaught exceptions and unhandled rejection handlers were the first listeners for those events. Apparently Google cloud function's framework sets listeners for those that call process.exit()... I'd like my errors to be logged nicely, by winston, before the cloud function framework blows up. After writing some code to ensure wintson's listeners were first, tsc let me know that rejections wasn't defined on Logger!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions