3 ms·
I may be wrong, but I always thought stderr was for diagnostic messages as well as errors, in which case red wouldn't really be appropriate. I almost think we
by udp 15y ago
I may be wrong, but I always thought stderr was for diagnostic messages as well as errors, in which case red wouldn't really be appropriate.
I almost think we need another output stream for something that's neither an error nor output of the program.
- jzwinck 15y agoC++ has std::clog (http://www.cplusplus.com/reference/iostream/clog/ http://www.cplusplus.com/reference/iostream/clog/) but most people haven't heard of it and it maps to stderr anyway.
- Jach 15y agoI don't know, I kind of have mixed feelings about adding another stream. I'd probably find stdinfo and stdwarn useful. But it's a slippery slope to duplicating the features of a full logging system; you might add stdinfo, stdwarn, stdfine, stdfiner, stdfinest, stdconfig, std$custom, etc. etc. One nice thing about having only stdout and stderr is it pushes you to ask: "Is this piece of information actually necessary to display to the user or should it just be logged to a file somewhere?" I'm not sure everyone really asks that though. Every time someone shoves a bunch of needless information to stderr "just in case" is a time I have to 2> /dev/null. (At least the useless stuff is often in stderr so I don't have to grep it out of stdout.)
- anko 15y agoI think this is a marvellous idea. I would love to see a meta stream, that allows you to mark up semantics of stdout/stderr. How would you go about creating a new standard stream?