]> source.dussan.org Git - rspamd.git/commitdiff
Implement printing of scores in the log file
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 2 Jan 2016 00:00:59 +0000 (00:00 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 2 Jan 2016 00:00:59 +0000 (00:00 +0000)
src/libserver/task.c

index 4f3a9d72c9bd3522b16a6bf6b0233ae9b1805a75..290101023427b070b3e494cb606094271a62b0c2 100644 (file)
@@ -733,11 +733,23 @@ rspamd_task_log_metric_res (struct rspamd_task *task,
                                sym = (struct symbol *) v;
 
                                if (first) {
-                                       rspamd_printf_fstring (&symbuf, "%s", sym->name);
+                                       if (lf->flags & RSPAMD_LOG_FLAG_SYMBOLS_SCORES) {
+                                               rspamd_printf_fstring (&symbuf, "%s(%.2f)", sym->name,
+                                                               sym->score);
+                                       }
+                                       else {
+                                               rspamd_printf_fstring (&symbuf, "%s", sym->name);
+                                       }
                                        first = FALSE;
                                }
                                else {
-                                       rspamd_printf_fstring (&symbuf, ",%s", sym->name);
+                                       if (lf->flags & RSPAMD_LOG_FLAG_SYMBOLS_SCORES) {
+                                               rspamd_printf_fstring (&symbuf, ",%s(%.2f)", sym->name,
+                                                               sym->score);
+                                       }
+                                       else {
+                                               rspamd_printf_fstring (&symbuf, ",%s", sym->name);
+                                       }
                                }
                        }