diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-08-02 16:46:28 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-08-02 16:46:28 +0400 |
commit | 76ba7fe19e094bf447c6f9eeab5c4654c002f873 (patch) | |
tree | 5e8df11035f464e71c9172c23938b4891391d32c /src/controller.c | |
parent | c67ecf02a43fb17931c8aa9255ccf92dfc253981 (diff) | |
download | rspamd-76ba7fe19e094bf447c6f9eeab5c4654c002f873.tar.gz rspamd-76ba7fe19e094bf447c6f9eeab5c4654c002f873.zip |
* Add logging for fuzzy checks
* Add logging for learning
Diffstat (limited to 'src/controller.c')
-rw-r--r-- | src/controller.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/controller.c b/src/controller.c index 424db1271..6ef9f7e08 100644 --- a/src/controller.c +++ b/src/controller.c @@ -809,6 +809,7 @@ controller_read_socket (f_str_t * in, void *arg) /* Handle messages without text */ if (tokens == NULL) { i = rspamd_snprintf (out_buf, sizeof (out_buf), "learn failed, no tokens can be extracted (no text data)" CRLF); + msg_info ("learn failed for message <%s>, no tokens to extract", task->message_id); free_task (task, FALSE); if (!rspamd_dispatcher_write (session->dispatcher, out_buf, i, FALSE, FALSE)) { return FALSE; @@ -821,8 +822,9 @@ controller_read_socket (f_str_t * in, void *arg) statfile = get_statfile_by_symbol (session->worker->srv->statfile_pool, session->learn_classifier, session->learn_symbol, &st, TRUE); if (statfile == NULL) { + msg_info ("learn failed for message <%s>, no statfile found: %s", task->message_id, session->learn_symbol); free_task (task, FALSE); - i = rspamd_snprintf (out_buf, sizeof (out_buf), "learn failed" CRLF); + i = rspamd_snprintf (out_buf, sizeof (out_buf), "learn failed, invalid symbol" CRLF); if (!rspamd_dispatcher_write (session->dispatcher, out_buf, i, FALSE, FALSE)) { return FALSE; } @@ -842,7 +844,8 @@ controller_read_socket (f_str_t * in, void *arg) if (st->normalizer != NULL) { sum = st->normalizer (session->cfg, sum, st->normalizer_data); } - + msg_info ("learn success for message <%s>, for statfile: %s, sum weight: %.2f", + task->message_id, session->learn_symbol, sum); free_task (task, FALSE); i = rspamd_snprintf (out_buf, sizeof (out_buf), "learn ok, sum weight: %.2f" CRLF, sum); if (!rspamd_dispatcher_write (session->dispatcher, out_buf, i, FALSE, FALSE)) { |