3 ms·
I believe the logic is that error handling (std::cerr) is optimized for being immediate because you need to see that last error message before your program went
by kbsletten 11y ago
I believe the logic is that error handling (std::cerr) is optimized for being immediate because you need to see that last error message before your program went off the rails.
Logging (std::clog) on the other hand is optimized for throughput since you expect to use some of that even in the happy path and don't want to bog everything down. I believe that since they're both associated with stderr, the error handling routine will also flush the last of the log.