webdis icon indicating copy to clipboard operation
webdis copied to clipboard

Bug in log messages

Open inovikovmfg opened this issue 9 years ago • 0 comments

Hello, I have noticed that before each log message goes some number, i.e. "42". Trying to figure out what it was lead me to slog.c where I found this:

const char c = ".-#"; ... line_sz = snprintf(line, sizeof(line), "[%d] %s %d %s\n", (int)s->log.self, time_buf, c[level], msg);

The chars are being printed as integers with %d, this is why we see their ASCII codes instead of symbols themselves. Another problem here is that you have 5 levels of verbosity, but only 4 symbols for them. That makes WEBDIS_DEBUG be printed as "0" because you get out of the array boundaries.

inovikovmfg avatar Nov 20 '15 11:11 inovikovmfg