From: Vsevolod Stakhov Date: Mon, 24 Feb 2020 14:05:50 +0000 (+0000) Subject: [Minor] Add fuzzy hash creation time to the log X-Git-Tag: 2.4~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aaeb83acfc2b5b9760c8593d58517c4f6962052a;p=thirdparty%2Frspamd.git [Minor] Add fuzzy hash creation time to the log --- diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 475417147d..3a0827a92a 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,