From e09c024c33d602ee363b8cb42f6a6a0cf4174932 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 7 Aug 2025 14:34:12 -0400 Subject: [PATCH] metrics: Only coung LD_BUG if they are warn/err Fixes #41104 Signed-off-by: David Goulet --- changes/ticket41104 | 3 +++ src/lib/log/log.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changes/ticket41104 diff --git a/changes/ticket41104 b/changes/ticket41104 new file mode 100644 index 0000000000..40de866ca6 --- /dev/null +++ b/changes/ticket41104 @@ -0,0 +1,3 @@ + o Minor bugfixes (logging, metrics port): + - Count BUG statements for the MetricsPort only if they are warnings or + errors. Fixes bug 41104; bugfix on 0.4.7.1. diff --git a/src/lib/log/log.c b/src/lib/log/log.c index aecd838c5d..3cfbb603be 100644 --- a/src/lib/log/log.c +++ b/src/lib/log/log.c @@ -707,7 +707,7 @@ log_fn_(int severity, log_domain_mask_t domain, const char *fn, const char *format, ...) { va_list ap; - if (domain & LD_BUG) + if ((domain & LD_BUG) && (severity >= LOG_WARN)) tor_bug_increment_count_(); if (severity > log_global_min_severity_) return; @@ -721,7 +721,7 @@ log_fn_ratelim_(ratelim_t *ratelim, int severity, log_domain_mask_t domain, { va_list ap; char *m; - if (domain & LD_BUG) + if ((domain & LD_BUG) && (severity >= LOG_WARN)) tor_bug_increment_count_(); if (severity > log_global_min_severity_) return; -- 2.47.2