From f3d826b0c5f2e2212f69a92f4fe79d8c973807f7 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Mon, 15 Jun 2015 17:28:59 +0200 Subject: [PATCH] mxq_log: Log to stderr and not to stdout --- mxq_log.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mxq_log.c b/mxq_log.c index e11fa47..d59ffac 100644 --- a/mxq_log.c +++ b/mxq_log.c @@ -72,9 +72,9 @@ int mx_log_print(char *msg, size_t len) timetag(timebuf, sizeof(timebuf)); if (cnt > 1) - printf("%s %s[%d]: last message repeated %d times\n", timebuf, program_invocation_short_name, getpid(), cnt); + fprintf(stderr, "%s %s[%d]: last message repeated %d times\n", timebuf, program_invocation_short_name, getpid(), cnt); else if (cnt == 1) - printf("%s %s[%d]: %s\n", timebuf, program_invocation_short_name, getpid(), lastmsg); + fprintf(stderr, "%s %s[%d]: %s\n", timebuf, program_invocation_short_name, getpid(), lastmsg); if (lastmsg) mx_free_null(lastmsg); @@ -83,8 +83,8 @@ int mx_log_print(char *msg, size_t len) lastlen = len; cnt = 0; - printf("%s %s[%d]: %s\n", timebuf, program_invocation_short_name, getpid(), msg); - fflush(stdout); + fprintf(stderr, "%s %s[%d]: %s\n", timebuf, program_invocation_short_name, getpid(), msg); + fflush(stderr); return 1; }