[tor-commits] [tor/master] Add "Heartbeat" to the start of several heartbeat messages.

nickm at torproject.org nickm at torproject.org
Fri Mar 19 17:35:23 UTC 2021


commit 0229d5f81862e8ef6765c6e1e7e6cd78a5a2b4cc
Author: Nick Mathewson <nickm at torproject.org>
Date:   Fri Mar 19 13:33:56 2021 -0400

    Add "Heartbeat" to the start of several heartbeat messages.
    
    Closes #40322.
---
 changes/ticket40322    | 3 +++
 src/core/or/dos.c      | 3 ++-
 src/core/or/status.c   | 2 +-
 src/test/test_status.c | 4 ++--
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/changes/ticket40322 b/changes/ticket40322
new file mode 100644
index 0000000000..18a65b3323
--- /dev/null
+++ b/changes/ticket40322
@@ -0,0 +1,3 @@
+  o Minor features (logging):
+    - Edit heartbeat log messages so that more of them begin with the string
+      "Heartbeat: ".  Closes ticket 40322; patch from 'cypherpunks'.
diff --git a/src/core/or/dos.c b/src/core/or/dos.c
index a5ea53bb3e..e8652c901e 100644
--- a/src/core/or/dos.c
+++ b/src/core/or/dos.c
@@ -819,7 +819,8 @@ dos_log_heartbeat(void)
 
   char *msg = smartlist_join_strings(elems, ", ", 0, NULL);
 
-  log_notice(LD_HEARTBEAT, "DoS mitigation since startup: %s.", msg);
+  log_notice(LD_HEARTBEAT,
+             "Heartbeat: DoS mitigation since startup: %s.", msg);
 
   tor_free(msg);
   SMARTLIST_FOREACH(elems, char *, e, tor_free(e));
diff --git a/src/core/or/status.c b/src/core/or/status.c
index df9577ada5..9e7ae70535 100644
--- a/src/core/or/status.c
+++ b/src/core/or/status.c
@@ -105,7 +105,7 @@ log_onion_service_stats(void)
   }
 
   log_notice(LD_HEARTBEAT,
-             "Our onion service%s received %u v3 INTRODUCE2 cells "
+             "Heartbeat: Our onion service%s received %u v3 INTRODUCE2 cells "
              "and attempted to launch %d rendezvous circuits.",
              num_services == 1 ? "" : "s",
              hs_stats_get_n_introduce2_v3_cells(),
diff --git a/src/test/test_status.c b/src/test/test_status.c
index 284a6b7eaf..1d371645ae 100644
--- a/src/test/test_status.c
+++ b/src/test/test_status.c
@@ -359,8 +359,8 @@ test_status_hb_not_in_consensus(void *arg)
                  "initiated 0 and received 0 v3 connections; "
                  "initiated 0 and received 0 v4 connections; "
                  "initiated 0 and received 0 v5 connections.\n");
-  expect_log_msg("DoS mitigation since startup: 0 circuits killed with "
-                 "too many cells, [DoSCircuitCreationEnabled disabled], "
+  expect_log_msg("Heartbeat: DoS mitigation since startup: 0 circuits killed "
+                 "with too many cells, [DoSCircuitCreationEnabled disabled], "
                  "[DoSConnectionEnabled disabled], "
                  "[DoSRefuseSingleHopClientRendezvous disabled], "
                  "0 INTRODUCE2 rejected.\n");



More information about the tor-commits mailing list