From: Vsevolod Stakhov Date: Wed, 23 Jul 2025 17:28:46 +0000 (+0100) Subject: [Minor] Reduce debug level verbosity X-Git-Tag: 3.13.0~38^2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e989261050e313c9051c22db01d29de396a843e6;p=thirdparty%2Frspamd.git [Minor] Reduce debug level verbosity --- diff --git a/src/libstat/backends/redis_backend.cxx b/src/libstat/backends/redis_backend.cxx index c897afb9bc..5d55bf3ace 100644 --- a/src/libstat/backends/redis_backend.cxx +++ b/src/libstat/backends/redis_backend.cxx @@ -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; } diff --git a/src/libstat/classifiers/bayes.c b/src/libstat/classifiers/bayes.c index 3fd7190aeb..52613d6489 100644 --- a/src/libstat/classifiers/bayes.c +++ b/src/libstat/classifiers/bayes.c @@ -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 */ } }