Skip to content
Snippets Groups Projects
Commit d8173c82 authored by Daniel Kahn Gillmor's avatar Daniel Kahn Gillmor
Browse files

Ensure that kr_log_info() gets sent promptly to stdout

If stdout is buffered, kr_log_info() might take ages to show up in the
output stream.  Since this stream could be interleaved with stderr
(e.g. kr_log_error()), it would be good to be able to see the messages
in the order in which they are generated.
parent 50eebc07
No related branches found
No related tags found
1 merge request!40Ensure that kr_log_info() gets sent promptly to stdout
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/* /*
* Logging and debugging. * Logging and debugging.
*/ */
#define kr_log_info(fmt, ...) printf((fmt), ## __VA_ARGS__) #define kr_log_info(fmt, ...) do { printf((fmt), ## __VA_ARGS__); fflush(stdout); } while(0)
#define kr_log_error(fmt, ...) fprintf(stderr, (fmt), ## __VA_ARGS__) #define kr_log_error(fmt, ...) fprintf(stderr, (fmt), ## __VA_ARGS__)
#ifndef NDEBUG #ifndef NDEBUG
/* Toggle debug messages */ /* Toggle debug messages */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment