-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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.group and console.groupCollapsed should write to stderr #55511
Comments
This is not a bug. console.group and similar commands log to stdout, not stderr. |
I agree that |
The spec leaves it up to the implementers to decide these things (https://console.spec.whatwg.org/#group), but it makes sense for it to go to stdout. It's not logging an error, so why go to stderr? Hyrum's law is always in effect, and this behavior is compatible with all the major runtimes, so changing it (which IMO isn't necessary at all) wouldn't be an easy task |
Your position is grounded on the assumption that So, to use the We do have the option of importing |
CC @nodejs/console |
To Hyrum’s Law, a program will break assuming that the output of |
Version
all
Platform
Subsystem
console
What steps will reproduce the bug?
Given the program
console-group.js
run
node console-group.js 2>/dev/null
How often does it reproduce? Is there a required condition?
consistently, all versions
What is the expected behavior? Why is that the expected behavior?
The above command should produce no output. This prevents a diagnostic from inadvertently interleaving text in parsable stdout.
One could argue the same should apply to
console.log
andconsole.info
and that all machine readable program output should be written toprocess.stdout
explicitly, but that ship has sailed.What do you see instead?
Send group labels to stderr.
Additional information
No response
The text was updated successfully, but these errors were encountered: