diff --git a/mxq_log.c b/mxq_log.c index 77b40b5f..b55f209c 100644 --- a/mxq_log.c +++ b/mxq_log.c @@ -46,45 +46,18 @@ int mx_log_print(char *msg, size_t len) { char timebuf[1024]; - static char *lastmsg = NULL; - static size_t lastlen = 0; - static int cnt = 0; - if (!msg) { - mx_free_null(lastmsg); return 0; } if (!len) return 0; - if (!*msg) - return -(errno=EINVAL); - - if (lastmsg && lastlen == len) { - if (mx_streq(msg, lastmsg)) { - cnt++; - mx_free_null(msg); - return 2; - } - } - timetag(timebuf, sizeof(timebuf)); - if (cnt > 1) - fprintf(stderr, "%s %s[%d]: last message repeated %d times\n", timebuf, program_invocation_short_name, getpid(), cnt); - else if (cnt == 1) - fprintf(stderr, "%s %s[%d]: %s\n", timebuf, program_invocation_short_name, getpid(), lastmsg); - - if (lastmsg) - mx_free_null(lastmsg); - - lastmsg = msg; - lastlen = len; - cnt = 0; - fprintf(stderr, "%s %s[%d]: %s\n", timebuf, program_invocation_short_name, getpid(), msg); fflush(stderr); + mx_free_null(msg); return 1; }