diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-08-28 15:58:55 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-08-28 15:58:55 +0100 |
commit | 83098d8daeb7444f14df39b3b4b29e13d56fdd0b (patch) | |
tree | 79b55a271397df81760b4e4d9a47c9df9449c9c0 /src | |
parent | c18e3f0450cd97b85cd569edd4a06bcda66fdef4 (diff) | |
download | rspamd-83098d8daeb7444f14df39b3b4b29e13d56fdd0b.tar.gz rspamd-83098d8daeb7444f14df39b3b4b29e13d56fdd0b.zip |
Fix extended output.
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/logger.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libutil/logger.c b/src/libutil/logger.c index 9adf389b8..b180b9dc5 100644 --- a/src/libutil/logger.c +++ b/src/libutil/logger.c @@ -749,20 +749,25 @@ file_log_function (const gchar *log_domain, } if (function != NULL) { mr = rspamd_snprintf (m, mremain, "%s: ", function); + m += mr; + mremain -= mr; } else { mr = rspamd_snprintf (m, mremain, ": ", function); + m += mr; + mremain -= mr; } /* Construct IOV for log line */ iov[0].iov_base = tmpbuf; iov[0].iov_len = r; iov[1].iov_base = modulebuf; - iov[1].iov_len = mr; + iov[1].iov_len = m - modulebuf; iov[2].iov_base = (void *) message; iov[2].iov_len = mlen; iov[3].iov_base = (void *) &lf_chr; iov[3].iov_len = 1; + if (rspamd_log->cfg->log_color) { iov[4].iov_base = "\033[0m"; iov[4].iov_len = sizeof ("\033[0m") - 1; |