aboutsummaryrefslogtreecommitdiff
path: root/src/logging.h
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2024-07-04 00:52:29 +1000
committerAnthony Towns <aj@erisian.com.au>2024-07-12 10:30:39 +1000
commit0b1960f1b29cfe5209ac68102c8643fc9553f247 (patch)
treec26c6c716b5933a0b41b43aa634edfaead37ef52 /src/logging.h
parent6bbc2dd6c50f09ff1e70423dc29a404b570f5b69 (diff)
downloadbitcoin-0b1960f1b29cfe5209ac68102c8643fc9553f247.tar.xz
logging: Add DisableLogging()
Diffstat (limited to 'src/logging.h')
-rw-r--r--src/logging.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/logging.h b/src/logging.h
index 2f24f32886..70539f03b0 100644
--- a/src/logging.h
+++ b/src/logging.h
@@ -157,6 +157,14 @@ namespace BCLog {
/** Only for testing */
void DisconnectTestLogger() EXCLUSIVE_LOCKS_REQUIRED(!m_cs);
+ /** Disable logging
+ * This offers a slight speedup and slightly smaller memory usage
+ * compared to leaving the logging system in its default state.
+ * Mostly intended for libbitcoin-kernel apps that don't want any logging.
+ * Should be used instead of StartLogging().
+ */
+ void DisableLogging() EXCLUSIVE_LOCKS_REQUIRED(!m_cs);
+
void ShrinkDebugFile();
std::unordered_map<LogFlags, Level> CategoryLevels() const EXCLUSIVE_LOCKS_REQUIRED(!m_cs)