cerr is not buffered! use it as debugging information, good or not?

because clog and cout are all buffered, so if you don't use endl to flush it, if you use them to print out debugging information, then there will be mistaken inferences. so I am thinking now that cerr is not buffered at all, why don't I use cerr to print all debugging information to avoid that risk?

Is it good enough?
Last edited on
We can enable or disable automatic flushing of the stream after every output for any output stream.
The only difference with std::cerr / std::wcerr is that unitbuf is on by default.

http://stdcxx.apache.org/doc/stdlibug/35-3.html
Last edited on
Thanks, JLBorges, that is something new!
Topic archived. No new replies allowed.