upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 52cda84..a5a4e80 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -7,6 +7,7 @@
7 7
8 8
9bool fDebug = false; 9bool fDebug = false;
10bool fDebugRelay = false;
10 11
11// In-process cap for debug.log, in bytes. Default matches the 1G trigger of 12// In-process cap for debug.log, in bytes. Default matches the 1G trigger of
12// the shipped logrotate policy so a long-running node stays bounded even 13// the shipped logrotate policy so a long-running node stays bounded even
@@ -31,10 +32,22 @@ static bool LogCategoryDefaultOn(const char* category)
31 strcmp(category, "payout") == 0; 32 strcmp(category, "payout") == 0;
32} 33}
33 34
35// Categories so noisy they drown out everything else even under -debug:
36// per-message send traces, wallet relay rebroadcasts, raw CBlock dumps and
37// per-address discovery lines made up ~90% of a 13-hour production capture
38// (issue #35). They need /debugrelay, not merely /debug.
39static bool LogCategoryVerboseOnly(const char* category)
40{
41 return strcmp(category, "relay") == 0 ||
42 strcmp(category, "nostrdiscovery") == 0;
43}
44
34bool LogAcceptsCategory(const char* category) 45bool LogAcceptsCategory(const char* category)
35{ 46{
36 if (LogCategoryDefaultOn(category)) 47 if (LogCategoryDefaultOn(category))
37 return true; 48 return true;
49 if (LogCategoryVerboseOnly(category))
50 return fDebugRelay;
38 return fDebug; 51 return fDebug;
39} 52}
40 53