Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



I 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.)


C++ has std::clog (http://www.cplusplus.com/reference/iostream/clog/) but most people haven't heard of it and it maps to stderr anyway.


I 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?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: