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

Passing Error object as an argument (instead of message) #1351

Closed
MOZGIII opened this issue Jun 5, 2018 · 1 comment
Closed

Passing Error object as an argument (instead of message) #1351

MOZGIII opened this issue Jun 5, 2018 · 1 comment

Comments

@MOZGIII
Copy link

MOZGIII commented Jun 5, 2018

Hi, I stumbled upon this example:

//
// TODO: THIS IS BROKEN & MUST BE FIXED BEFORE 3.0
// This should output what was previously referred to
// as "humanReadableUncaughtExceptions" by default.
//
const logger = winston.createLogger({
format: winston.format.simple(),
transports: [
new winston.transports.Console({ handleExceptions: true })
]
});

As the comment says, it doesn't work. And today is 5-th of June.
TypeScript definitions for LogMethod and LeveledLogMethod are broken too, as they won't allow specifying just an error and the log level:

logger.log("error", new Error("testing")); // typescript won't compile
@DABH
Copy link
Contributor

DABH commented Sep 3, 2018

We are tracking work on supporting Error objects in #1338 -- hopefully will have updates there soon. Thanks for using winston, let us know if you hit other issues!

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

No branches or pull requests

2 participants