diff options
author | Anthony Towns <aj@erisian.com.au> | 2024-07-04 00:52:29 +1000 |
---|---|---|
committer | Anthony Towns <aj@erisian.com.au> | 2024-07-12 10:30:39 +1000 |
commit | 0b1960f1b29cfe5209ac68102c8643fc9553f247 (patch) | |
tree | c26c6c716b5933a0b41b43aa634edfaead37ef52 /src/logging.h | |
parent | 6bbc2dd6c50f09ff1e70423dc29a404b570f5b69 (diff) | |
download | bitcoin-0b1960f1b29cfe5209ac68102c8643fc9553f247.tar.xz |
logging: Add DisableLogging()
Diffstat (limited to 'src/logging.h')
-rw-r--r-- | src/logging.h | 8 |
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) |