From: Vsevolod Stakhov Date: Tue, 3 Apr 2018 16:57:40 +0000 (+0100) Subject: [Minor] Move some important messages to higher log level X-Git-Tag: 1.7.3~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bedfdd15011a34449432cd2d3a5afd36c89423a6;p=thirdparty%2Frspamd.git [Minor] Move some important messages to higher log level --- diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index d1f1da7971..f9e9b30517 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -686,7 +686,7 @@ urls_protocol_cb (gpointer key, gpointer value, gpointer ud) len = task->from_envelope->addr_len; } - msg_info_task_encrypted ("<%s> %s: %*s; ip: %s; URL: %*s", + msg_notice_task_encrypted ("<%s> %s: %*s; ip: %s; URL: %*s", task->message_id, has_user ? "user" : "from", len, user_field, @@ -1211,7 +1211,7 @@ rspamd_protocol_http_reply (struct rspamd_http_message *msg, if (task->cfg->log_flags & RSPAMD_LOG_FLAG_RE_CACHE) { restat = rspamd_re_cache_get_stat (task->re_rt); g_assert (restat != NULL); - msg_info_task ( + msg_notice_task ( "regexp statistics: %ud pcre regexps scanned, %ud regexps matched," " %ud regexps total, %ud regexps cached," " %HL bytes scanned using pcre, %HL bytes scanned total", diff --git a/src/libserver/task.c b/src/libserver/task.c index e723fd9556..55adc1a4f9 100644 --- a/src/libserver/task.c +++ b/src/libserver/task.c @@ -1467,7 +1467,7 @@ rspamd_task_write_log (struct rspamd_task *task) } } - msg_info_task ("%V", logbuf); + msg_notice_task ("%V", logbuf); rspamd_fstring_free (logbuf); } diff --git a/src/libutil/logger.c b/src/libutil/logger.c index 0e057d1d8b..0313638b63 100644 --- a/src/libutil/logger.c +++ b/src/libutil/logger.c @@ -1029,7 +1029,7 @@ file_log_function (const gchar *module, const gchar *id, cptype = g_quark_to_string (rspamd_log->process_type); if (rspamd_log->flags & RSPAMD_LOG_FLAG_COLOR) { - if (level_flags & G_LOG_LEVEL_INFO) { + if (level_flags & (G_LOG_LEVEL_INFO|G_LOG_LEVEL_MESSAGE)) { /* White */ r = rspamd_snprintf (tmpbuf, sizeof (tmpbuf), "\033[0;37m"); } @@ -1115,7 +1115,7 @@ file_log_function (const gchar *module, const gchar *id, mlen = strlen (message); if (rspamd_log->flags & RSPAMD_LOG_FLAG_COLOR) { - if (level_flags & G_LOG_LEVEL_INFO) { + if (level_flags & (G_LOG_LEVEL_INFO|G_LOG_LEVEL_MESSAGE)) { /* White */ r = rspamd_snprintf (tmpbuf, sizeof (tmpbuf), "\033[0;37m"); } diff --git a/src/libutil/logger.h b/src/libutil/logger.h index e48e1161ac..3b55246eaf 100644 --- a/src/libutil/logger.h +++ b/src/libutil/logger.h @@ -244,6 +244,10 @@ extern guint rspamd_task_log_id; task->task_pool->tag.tagname, task->task_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) +#define msg_notice_task_encrypted(...) rspamd_default_log_function (G_LOG_LEVEL_MESSAGE|RSPAMD_LOG_ENCRYPTED, \ + task->task_pool->tag.tagname, task->task_pool->tag.uid, \ + G_STRFUNC, \ + __VA_ARGS__) #define msg_info_task_encrypted(...) rspamd_default_log_function (G_LOG_LEVEL_INFO|RSPAMD_LOG_ENCRYPTED, \ task->task_pool->tag.tagname, task->task_pool->tag.uid, \ G_STRFUNC, \ @@ -257,7 +261,11 @@ extern guint rspamd_task_log_id; task ? task->task_pool->tag.tagname : NULL, task ? task->task_pool->tag.uid : NULL, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_info_task_check(...) rspamd_default_log_function (G_LOG_LEVEL_INFO, \ +#define msg_info_task_check(...) rspamd_default_log_function (G_LOG_LEVEL_MESSAGE, \ + task ? task->task_pool->tag.tagname : NULL, task ? task->task_pool->tag.uid : NULL, \ + G_STRFUNC, \ + __VA_ARGS__) +#define msg_notice_task_check(...) rspamd_default_log_function (G_LOG_LEVEL_INFO, \ task ? task->task_pool->tag.tagname : NULL, task ? task->task_pool->tag.uid : NULL, \ G_STRFUNC, \ __VA_ARGS__)