You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior? Why is that the expected behavior?
Nothing is printed, since I redirect stderr to /dev/null.
What do you see instead?
Restarting 'index.mjs' is printed (to stdout).
Additional information
How to use stdout and stderr is purely conventional, but the GNU C library says:
stdout: The standard output stream, which is used for normal output from the program.
stderr: The standard error stream, which is used for error messages and diagnostics issued by the program.
I’m making a program that reads input from stdin and writes to stdout. It is a long-lived program: Another program writes to stdin over time, and consumes output from stdout. I use --watch so I can iterate on the sub-program more easily. Unfortunately, --watch writes messages to stdout, causing the consuming program to receive output it does not expect.
I would argue that my program creates the “normal output” while the --watch messages are “diagnostics”.
Here’s one of the places where stdout is used instead of stderr:
Version
v22.12.0
Platform
Subsystem
node/lib/internal/main/watch_mode.js
What steps will reproduce the bug?
In another terminal:
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior? Why is that the expected behavior?
Nothing is printed, since I redirect stderr to
/dev/null
.What do you see instead?
Restarting 'index.mjs'
is printed (to stdout).Additional information
How to use stdout and stderr is purely conventional, but the GNU C library says:
I’m making a program that reads input from stdin and writes to stdout. It is a long-lived program: Another program writes to stdin over time, and consumes output from stdout. I use
--watch
so I can iterate on the sub-program more easily. Unfortunately,--watch
writes messages to stdout, causing the consuming program to receive output it does not expect.I would argue that my program creates the “normal output” while the
--watch
messages are “diagnostics”.Here’s one of the places where stdout is used instead of stderr:
node/lib/internal/main/watch_mode.js
Line 139 in 9400eae
Is there a reason for this? Should it be changed to stderr?
The text was updated successfully, but these errors were encountered: