Commit e148832c authored by Shawn Webb's avatar Shawn Webb
Browse files

stdio log: flush stderr, stdout after fprintf



This ensures that log messages are printed on the screen in proper
order.
Signed-off-by: Shawn Webb's avatarShawn Webb <shawn.webb@hardenedbsd.org>
parent 9d0baa1a
......@@ -75,6 +75,7 @@ _lattutil_log_stdio_debug(lattutil_log_t *logp, int verbose,
}
len = strlen(msg);
fprintf(stderr, "DEBUG: %s\n", msg);
fflush(stderr);
free(msg);
}
va_end(args);
......@@ -105,6 +106,7 @@ _lattutil_log_stdio_err(lattutil_log_t *logp, int verbose,
}
len = strlen(msg);
fprintf(stderr, "ERROR: %s\n", msg);
fflush(stderr);
free(msg);
}
va_end(args);
......@@ -135,6 +137,7 @@ _lattutil_log_stdio_info(lattutil_log_t *logp, int verbose,
}
len = strlen(msg);
fprintf(stdout, "INFO: %s\n", msg);
fflush(stdout);
free(msg);
}
va_end(args);
......@@ -165,6 +168,7 @@ _lattutil_log_stdio_warn(lattutil_log_t *logp, int verbose,
}
len = strlen(msg);
fprintf(stderr, "WARNING: %s\n", msg);
fflush(stderr);
free(msg);
}
va_end(args);
......
Markdown is supported
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