-
-
Notifications
You must be signed in to change notification settings - Fork 35.7k
Colorize console.error output to make it distinguishable #40361
Copy link
Copy link
Closed
Labels
consoleIssues and PRs related to the console subsystem.Issues and PRs related to the console subsystem.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.
Metadata
Metadata
Assignees
Labels
consoleIssues and PRs related to the console subsystem.Issues and PRs related to the console subsystem.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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