-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
console.error enhancement #4452
Comments
I like this suggestion |
This will impact behaviour of So, from what I gather, it's the way |
I always forget to add the check for |
I would also like this, but on the other hand I'm sure there are a lot of libraries out there that use |
Yea I think it should be a change to util.inspect though for Errors. I think that would make the change less breaking to the ecosystem (although still a major change) |
I agree that the change should be in Edit: I can pick this up and make the changes in |
Certainly |
Previously, Error objects were formatted as the result of a `toString` call bounded by square brackets. They are now formatted as the stack trace for the given error object. The intention initially was to emulate how browsers do `console.error` but since that would also impact `console.warn`, `console.log`, etc, it was decided to make the change at `util.inspect` level which is in turn used by the `console` package. Fixes: nodejs#4452
Previously, Error objects were formatted as the result of a `toString` call bounded by square brackets. They are now formatted as the stack trace for the given error object. The intention initially was to emulate how browsers do `console.error` but since that would also impact `console.warn`, `console.log`, etc, it was decided to make the change at `util.inspect` level which is in turn used by the `console` package. Fixes: nodejs#4452 PR-URL: nodejs#4582 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
I'm not sure exactly how this works and if this is the right place to raise the issue but:
In the browser (chrome)
In node:
Is it possible to make it so that node will automatically add stack traces on console.error?
The text was updated successfully, but these errors were encountered: