]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Move some important messages to higher log level
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 3 Apr 2018 16:57:40 +0000 (17:57 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 3 Apr 2018 16:57:59 +0000 (17:57 +0100)
src/libserver/protocol.c
src/libserver/task.c
src/libutil/logger.c
src/libutil/logger.h

index d1f1da797160d435c2d5eb608e8c6bfbaad99e4b..f9e9b3051729e16d2f25483ebebe23afe5350c71 100644 (file)
@@ -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",
index e723fd9556d9e9fd476060d45b34525e6d4dc72c..55adc1a4f9ac02eb713a68e0da8c09bac9656ccc 100644 (file)
@@ -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);
 }
index 0e057d1d8bade774e27a00b808d51c6f43a34d60..0313638b63a66f4b74f4897ccfb4d6f8ac30ee2c 100644 (file)
@@ -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");
                        }
index e48e1161ace26c6551b549f0a4fa2a7c06a7e210..3b55246eaf9e65a660cd4f7a961c7f7f4ed52ec5 100644 (file)
@@ -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__)