aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-02 00:00:59 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-02 00:00:59 +0000
commitf66d2ffef3a6ef62c5b39b9dd86ab15aa44d3c3f (patch)
tree1f9e1fa6fa9307fd76d41fcb63a8c90c0fdd12a8 /src/libserver
parentaf918845b6a04565a60c7eb7058099575db2d281 (diff)
downloadrspamd-f66d2ffef3a6ef62c5b39b9dd86ab15aa44d3c3f.tar.gz
rspamd-f66d2ffef3a6ef62c5b39b9dd86ab15aa44d3c3f.zip
Implement printing of scores in the log file
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/task.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/libserver/task.c b/src/libserver/task.c
index 4f3a9d72c..290101023 100644
--- a/src/libserver/task.c
+++ b/src/libserver/task.c
@@ -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);
+ }
}
}