Repository navigation
Colorize console.error output to make it distinguishable #40361
Description
Activity
- addedconsoleIssues and PRs related to the console subsystem.Issues and PRs related to the console subsystem.feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Oct 7, 2021 There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.
- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Apr 6, 2022 console.log outputs in color in visual studio code and supports %c. Having the same capability when writing to the console would be consistent and invaluable.
- removedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Apr 23, 2022 There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.
- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Oct 20, 2022 Still actual for node 19.0.0
- removedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Oct 21, 2022 There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.
- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Apr 20, 2023 The lack of feedback from either maintainers or users suggests there's not demand for this feature. I'll go ahead and close out the issue.
The lack of feedback from either maintainers or users suggests there's not demand for this feature. I'll go ahead and close out the issue.
@bnoordhuis this is something that'd like to see implemented in nodejs, right now the solutions I've tried (including the one I've made) either don't do exactly what I want to do or don't work (eg loosing stack traces). Looking at the PR, it seems that it's ready for review?
pls different color for console.log, console.debug, console.warn and console.error. perhaps blue for debug, yellow for warn and red for error. would make development way nicer!
Reacted by Vsevolod FedorovI would also love to have colors on console.error and console.warn please. In browsers devtools, these methods have differents colors...
- moved this from In Progress to Pending Triage in Node.js feature requests
on Feb 1, 2024 - removedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Feb 2, 2024 Completed by #51629
Reacted by Luke Schoen
Is your feature request related to a problem? Please describe.
Node.js: 16.8.0
Currently,
console.error(err)outputs plain text, so it doesn't bring attention when scrolling the output.For example,
Error: Server not readyis printed as plain text here:Describe the solution you'd like
Would be great if
console.errorwould produce output in red. As we can see in the screenshot, it already colors the stack trace (the lines are printed in dimmed color). Is it possible to extend coloring to print the error message in red?Describe alternatives you've considered
One could use 3rd party packages like https://www.npmjs.com/package/colors, but it's not as convenient as having it out-of-the-box. Also, it's tricky to make it working with
Errorobjects.Related SO question: https://stackoverflow.com/questions/50608313/how-to-get-node-js-console-error-and-console-warn-output-in-color