I was wondering what is the point of clogging up? As far as I can tell, clog is similar to cerr, but with buffering, so it is more efficient. Usually stderr is the same as stdout, so clog is similar to cout. It seems very lame to me, so I suppose it must be misunderstood. If I have log messages that go to the same place, I get error messages (maybe something in / var / log / messages), then I probably don't write too much (so not so much lost, buffered cerr). In my experience, I want my log messages to be updated (not buffered), so I can help find a crash (so I don't want to use a buffered shutter). Apparently, I should always use cerr.
I would like to be able to redirect a glitch inside my program. It would be useful to redirect cerr so that when I call the library procedure, I can control where cerr and clog happen. Can some compilers support this? I just checked DJGPP, and stdout is defined as the address of the FILE structure, so it is illegal to do something like "stdout = freopen (...)".
- Is it possible to redirect clog, cerr, cout, stdin, stdout and / or stderr?
- The only difference between buffers and cerr buffering?
- How do I (or find) a more reliable logging tool (links)?
c ++ logging log4cpp
markets Sep 09 '08 at 17:08 2008-09-09 17:08
source share