]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Reduce debug level verbosity
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 23 Jul 2025 17:28:46 +0000 (18:28 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 23 Jul 2025 17:28:46 +0000 (18:28 +0100)
src/libstat/backends/redis_backend.cxx
src/libstat/classifiers/bayes.c

index c897afb9bcd17604ea2f67e425d345970245db18..5d55bf3acedaafb615491bb0f03eadab0fc46c01 100644 (file)
@@ -152,13 +152,13 @@ public:
                        return false;
                }
 
-               msg_debug_bayes("processing tokens for statfile id=%d, results size=%uz, class=%s",
-                                               id, results->size(), stcf->class_name ? stcf->class_name : "unknown");
+               if (results->size() > 0) {
+                       msg_debug_bayes("processing %uz tokens for statfile id=%d, class=%s",
+                                                       results->size(), id, stcf->class_name ? stcf->class_name : "unknown");
+               }
 
                for (auto [idx, val]: *results) {
                        tok = (rspamd_token_t *) g_ptr_array_index(tokens, idx - 1);
-                       msg_debug_bayes("setting tok->values[%d] = %.2f for token idx %d (class=%s)",
-                                                       id, val, idx, stcf->class_name ? stcf->class_name : "unknown");
                        tok->values[id] = val;
                }
 
index 3fd7190aeb82de2ed0f1ffa8135912fe12ddb5fe..52613d64897e30cdb21b7b39cead82b8cf1ad0fd 100644 (file)
@@ -229,36 +229,7 @@ bayes_classify_token(struct rspamd_classifier *ctx,
                        token_type = "meta";
                }
 
-               if (tok->t1 && tok->t2) {
-                       msg_debug_bayes("token(%s) %uL <%*s:%*s>: weight: %f, cf: %f, "
-                                                       "total_count: %ud, "
-                                                       "spam_count: %ud, ham_count: %ud,"
-                                                       "spam_prob: %.3f, ham_prob: %.3f, "
-                                                       "bayes_spam_prob: %.3f, bayes_ham_prob: %.3f, "
-                                                       "current spam probability: %.3f, current ham probability: %.3f",
-                                                       token_type,
-                                                       tok->data,
-                                                       (int) tok->t1->stemmed.len, tok->t1->stemmed.begin,
-                                                       (int) tok->t2->stemmed.len, tok->t2->stemmed.begin,
-                                                       fw, w, total_count, spam_count, ham_count,
-                                                       spam_prob, ham_prob,
-                                                       bayes_spam_prob, bayes_ham_prob,
-                                                       cl->spam_prob, cl->ham_prob);
-               }
-               else {
-                       msg_debug_bayes("token(%s) %uL <?:?>: weight: %f, cf: %f, "
-                                                       "total_count: %ud, "
-                                                       "spam_count: %ud, ham_count: %ud,"
-                                                       "spam_prob: %.3f, ham_prob: %.3f, "
-                                                       "bayes_spam_prob: %.3f, bayes_ham_prob: %.3f, "
-                                                       "current spam probability: %.3f, current ham probability: %.3f",
-                                                       token_type,
-                                                       tok->data,
-                                                       fw, w, total_count, spam_count, ham_count,
-                                                       spam_prob, ham_prob,
-                                                       bayes_spam_prob, bayes_ham_prob,
-                                                       cl->spam_prob, cl->ham_prob);
-               }
+               /* Per-token debug logging removed to reduce verbosity */
        }
 }
 
@@ -347,14 +318,7 @@ bayes_classify_token_multiclass(struct rspamd_classifier *ctx,
                        cl->text_tokens++;
                }
 
-               if (tok->t1 && tok->t2) {
-                       msg_debug_bayes("token(%s) %uL <%*s:%*s>: weight: %.3f, total_count: %ud, "
-                                                       "processed for %ud classes",
-                                                       token_type, tok->data,
-                                                       (int) tok->t1->stemmed.len, tok->t1->stemmed.begin,
-                                                       (int) tok->t2->stemmed.len, tok->t2->stemmed.begin,
-                                                       fw, total_count, cl->num_classes);
-               }
+               /* Per-token debug logging removed to reduce verbosity */
        }
 }