commit f78a04d: [Minor] Neural: Add logging stuff

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Feb 5 11:49:07 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-02-05 11:42:40 +0000
URL: https://github.com/rspamd/rspamd/commit/f78a04d718ce147da5cf99e99e59c4e3d4d44146 (HEAD -> master)

[Minor] Neural: Add logging stuff

---
 lualib/plugins/neural.lua | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lualib/plugins/neural.lua b/lualib/plugins/neural.lua
index 433a17ac9..c35fc0eeb 100644
--- a/lualib/plugins/neural.lua
+++ b/lualib/plugins/neural.lua
@@ -655,22 +655,26 @@ local function process_rules_settings()
     selt.digest = lua_util.table_digest(selt.symbols)
     selt.prefix = redis_ann_prefix(rule, selt.name)
 
+    rspamd_logger.messagex(rspamd_config,
+        'use NN prefix for rule %s; settings id "%s"; symbols digest: "%s"',
+        selt.prefix, selt.name, selt.digest)
+
     lua_redis.register_prefix(selt.prefix, N,
         string.format('NN prefix for rule "%s"; settings id "%s"',
-            rule.prefix, selt.name), {
+            selt.prefix, selt.name), {
           persistent = true,
           type = 'zlist',
         })
     -- Versions
     lua_redis.register_prefix(selt.prefix .. '_\\d+', N,
         string.format('NN storage for rule "%s"; settings id "%s"',
-            rule.prefix, selt.name), {
+            selt.prefix, selt.name), {
           persistent = true,
           type = 'hash',
         })
     lua_redis.register_prefix(selt.prefix .. '_\\d+_spam', N,
         string.format('NN learning set (spam) for rule "%s"; settings id "%s"',
-            rule.prefix, selt.name), {
+            selt.prefix, selt.name), {
           persistent = true,
           type = 'list',
         })


More information about the Commits mailing list