Skip to content
Snippets Groups Projects
Commit 4f49430c authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

Merge branch 'unbuffer-kr_log_info' into 'master'

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.

See merge request !40
parents 50eebc07 d8173c82
Branches
Tags
No related merge requests found
......@@ -28,7 +28,7 @@
/*
* 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__)
#ifndef NDEBUG
/* Toggle debug messages */
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment