From 361fb6df11468548eb57856dad2e74b082dd7085 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 17 Feb 2017 13:09:33 +0000 Subject: [PATCH] [Minor] Log fuzzy command when processing changes Issue: #1267 --- src/plugins/fuzzy_check.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 1804e8648..38456f4ca 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -1959,6 +1959,7 @@ fuzzy_controller_io_callback (gint fd, short what, void *arg) return_finished } ret = return_want_more; guint i, nreplied; + const gchar *op = "process"; task = session->task; @@ -2005,9 +2006,17 @@ fuzzy_controller_io_callback (gint fd, short what, void *arg) ftype = "txt"; } + if (io->cmd.cmd == FUZZY_WRITE) { + op = "added"; + } + else if (io->cmd.cmd == FUZZY_DEL) { + op = "deleted"; + } + if (rep->prob > 0.5) { - msg_info_task ("processed fuzzy hash (%s) %*xs, list: %s:%d for " - "message <%s>", + msg_info_task ("%s fuzzy hash (%s) %*xs, list: %s:%d for " + "message <%s>", + op, ftype, (gint)sizeof (cmd->digest), cmd->digest, symbol, @@ -2015,10 +2024,11 @@ fuzzy_controller_io_callback (gint fd, short what, void *arg) session->task->message_id); } else { - msg_info_task ("cannot process fuzzy hash (%s) for message " + msg_info_task ("fuzzy hash (%s) for message cannot be %s" "<%s>, %*xs, " "list %s:%d, error: %d", ftype, + op, session->task->message_id, (gint)sizeof (cmd->digest), cmd->digest, symbol, -- 2.39.5