From: David Goulet Date: Thu, 7 Aug 2025 18:34:12 +0000 (-0400) Subject: metrics: Only coung LD_BUG if they are warn/err X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fmain;p=thirdparty%2Ftor.git metrics: Only coung LD_BUG if they are warn/err Fixes #41104 Signed-off-by: David Goulet --- 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;