diff --git a/mongoose.c b/mongoose.c index 4aff7d72..24a30a09 100644 --- a/mongoose.c +++ b/mongoose.c @@ -1832,11 +1832,10 @@ bool mg_log_prefix(int level, const char *file, int line, const char *fname) { char timebuf[21], buf[50] = ""; time_t t = time(NULL); struct tm tmp, *tm = gmtime_r(&t, &tmp); - int n, tag; - (void)tmp; + int n; + (void) tmp; strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S", tm); - tag = level == LL_ERROR ? 'E' : level == LL_INFO ? 'I' : ' '; - n = snprintf(buf, sizeof(buf), "%s %c %s:%d:%s", timebuf, tag, p, line, + n = snprintf(buf, sizeof(buf), "%s %d %s:%d:%s", timebuf, level, p, line, fname); if (n < 0 || n > (int) sizeof(buf) - 2) n = sizeof(buf) - 2; while (n < (int) sizeof(buf) - 1) buf[n++] = ' '; diff --git a/src/log.c b/src/log.c index f6e3c0d5..5c433b7c 100644 --- a/src/log.c +++ b/src/log.c @@ -36,11 +36,10 @@ bool mg_log_prefix(int level, const char *file, int line, const char *fname) { char timebuf[21], buf[50] = ""; time_t t = time(NULL); struct tm tmp, *tm = gmtime_r(&t, &tmp); - int n, tag; - (void)tmp; + int n; + (void) tmp; strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S", tm); - tag = level == LL_ERROR ? 'E' : level == LL_INFO ? 'I' : ' '; - n = snprintf(buf, sizeof(buf), "%s %c %s:%d:%s", timebuf, tag, p, line, + n = snprintf(buf, sizeof(buf), "%s %d %s:%d:%s", timebuf, level, p, line, fname); if (n < 0 || n > (int) sizeof(buf) - 2) n = sizeof(buf) - 2; while (n < (int) sizeof(buf) - 1) buf[n++] = ' ';