logging: Add DisableLogging()

This commit is contained in:
Anthony Towns
2024-07-04 00:52:29 +10:00
parent 6bbc2dd6c5
commit 0b1960f1b2
3 changed files with 27 additions and 0 deletions

View File

@@ -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)