-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Revert "console: colorize console error and warn" #54677
Revert "console: colorize console error and warn" #54677
Conversation
This reverts commit a833c9e.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #54677 +/- ##
==========================================
+ Coverage 87.33% 87.61% +0.27%
==========================================
Files 650 650
Lines 182832 182817 -15
Branches 35067 35371 +304
==========================================
+ Hits 159670 160166 +496
+ Misses 16421 15927 -494
+ Partials 6741 6724 -17
|
Thank you! |
@nodejs/console WDYT @MrJithil I'd love your review... as it reverts a PR you authored. |
I am -1 on reverting but won't block |
Why? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I find the stderr being marked red somewhat annoying, because stderr is also used quite often for debugging logs and there's nothing erroneous about them, it also misleads you into viewing warnings as errors, and reading a long error stack trace marked red to track things down has been very unpleasant to my eyes. I think it would be better to go with a $LS_COLORS like approach that allows users to use colors that works well with their shell/their use case.
Landed in 2d77ba5 |
This reverts commit a833c9e. PR-URL: nodejs#54677 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
The output of console.Console is colorized in Node.js >=20.15 <22.10 due to nodejs/node#51629 and nodejs/node#54677. Handle this in our test cases by comparing the output to the output of console.Console on a PassThrough stream. Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
@RedYetiDev |
Fixes #53661
This PR reverts #51629.
Why was this change made?
IMO The original PR introduces more issues than it resolves, negatively impacting the intended use of standard streams in several ways, such as:
Misuse of Standard Streams: The primary purpose of
stdout
is to handle program output, whereasstderr
is designated for diagnostics, status updates, and runtime user messages. Showing this output red may confuse users, as this content isn't always an error. (For example, runncu-ci
with no args...)Inconsistency in Color Handling: If the input passed to
console.error
orconsole.warn
already includes color formatting, the additional internal coloring introduced by the original PR can result in a clash of styles.CC @MrJithil