From: Vsevolod Stakhov Date: Wed, 18 Jul 2018 12:18:27 +0000 (+0100) Subject: [Minor] Add "stat_redis" debug module X-Git-Tag: 1.7.9~100 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cdffc67c726572a222dae58144502ec68c8b1359;p=rspamd.git [Minor] Add "stat_redis" debug module --- diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c index 2a14df469..9664a61a7 100644 --- a/src/libstat/backends/redis_backend.c +++ b/src/libstat/backends/redis_backend.c @@ -25,6 +25,12 @@ #include "adapters/libevent.h" #include "ref.h" +#define msg_debug_stat_redis(...) rspamd_conditional_debug_fast (NULL, NULL, \ + rspamd_stat_redis_log_id, "stat_redis", task->task_pool->tag.uid, \ + G_STRFUNC, \ + __VA_ARGS__) + +INIT_LOG_MODULE(stat_redis) #define REDIS_CTX(p) (struct redis_stat_ctx *)(p) #define REDIS_RUNTIME(p) (struct redis_stat_runtime *)(p) @@ -1084,7 +1090,7 @@ rspamd_redis_connected (redisAsyncContext *c, gpointer r, gpointer priv) } rt->learned = val; - msg_debug_task ("connected to redis server, tokens learned for %s: %uL", + msg_debug_stat_redis ("connected to redis server, tokens learned for %s: %uL", rt->redis_object_expanded, rt->learned); rspamd_upstream_ok (rt->selected); } @@ -1169,7 +1175,7 @@ rspamd_redis_processed (redisAsyncContext *c, gpointer r, gpointer priv) rspamd_redis_type_to_string (reply->type)); } - msg_debug_task_check ("received tokens for %s: %d processed, %d found", + msg_debug_stat_redis ("received tokens for %s: %d processed, %d found", rt->redis_object_expanded, processed, found); rspamd_upstream_ok (rt->selected); }