diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-02-24 14:05:50 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-02-24 14:05:50 +0000 |
commit | aaeb83acfc2b5b9760c8593d58517c4f6962052a (patch) | |
tree | 73552da357e6157f1a2425838592c71029f1b519 /src | |
parent | c8c047abd8c7dd20e0cca20e0e7d5f32b91428e8 (diff) | |
download | rspamd-aaeb83acfc2b5b9760c8593d58517c4f6962052a.tar.gz rspamd-aaeb83acfc2b5b9760c8593d58517c4f6962052a.zip |
[Minor] Add fuzzy hash creation time to the log
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/fuzzy_check.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 475417147..3a0827a92 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -2008,6 +2008,8 @@ fuzzy_insert_result (struct fuzzy_client_session *session, if (map != NULL || !session->rule->skip_unknown) { GList *fuzzy_var; rspamd_fstring_t *hex_result; + gchar timebuf[64]; + struct tm tm_split; if (session->rule->skip_map) { rspamd_encode_hex_buf (cmd->digest, sizeof (cmd->digest), @@ -2023,10 +2025,17 @@ fuzzy_insert_result (struct fuzzy_client_session *session, hexbuf, sizeof (hexbuf) - 1); hexbuf[sizeof (hexbuf) - 1] = '\0'; + rspamd_gmtime (rep->ts, &tm_split); + rspamd_snprintf (timebuf, sizeof (timebuf), "%02d.%02d.%4d %02d:%02d:%02d GMT", + tm_split.tm_mday, + tm_split.tm_mon, + tm_split.tm_year + 1900, + tm_split.tm_hour, tm_split.tm_min, tm_split.tm_sec); + if (is_fuzzy) { msg_info_task ( "found fuzzy hash(%s) %s (%*xs requested) with weight: " - "%.2f, probability %.2f, in list: %s:%d%s", + "%.2f, probability %.2f, in list: %s:%d%s; added on %s", type, hexbuf, (gint) sizeof (cmd->digest), cmd->digest, @@ -2034,19 +2043,21 @@ fuzzy_insert_result (struct fuzzy_client_session *session, (gdouble) rep->v1.prob, symbol, rep->v1.flag, - map == NULL ? "(unknown)" : ""); + map == NULL ? "(unknown)" : "", + timebuf); } else { msg_info_task ( "found exact fuzzy hash(%s) %s with weight: " - "%.2f, probability %.2f, in list: %s:%d%s", + "%.2f, probability %.2f, in list: %s:%d%s; added on %s", type, hexbuf, nval, (gdouble) rep->v1.prob, symbol, rep->v1.flag, - map == NULL ? "(unknown)" : ""); + map == NULL ? "(unknown)" : "", + timebuf); } rspamd_snprintf (buf, |