]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
metrics: Only coung LD_BUG if they are warn/err main
authorDavid Goulet <dgoulet@torproject.org>
Thu, 7 Aug 2025 18:34:12 +0000 (14:34 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Thu, 7 Aug 2025 18:34:12 +0000 (14:34 -0400)
Fixes #41104

Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/ticket41104 [new file with mode: 0644]
src/lib/log/log.c

diff --git a/changes/ticket41104 b/changes/ticket41104
new file mode 100644 (file)
index 0000000..40de866
--- /dev/null
@@ -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.
index aecd838c5d343a04d219a72726919e24de3d4815..3cfbb603beab963d774e8d099be9e4bee5bb726c 100644 (file)
@@ -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;