Changeset View
Changeset View
Standalone View
Standalone View
src/logging.h
Show All 15 Lines | |||||
#include <mutex> | #include <mutex> | ||||
#include <string> | #include <string> | ||||
static const bool DEFAULT_LOGTIMEMICROS = false; | static const bool DEFAULT_LOGTIMEMICROS = false; | ||||
static const bool DEFAULT_LOGIPS = false; | static const bool DEFAULT_LOGIPS = false; | ||||
static const bool DEFAULT_LOGTIMESTAMPS = true; | static const bool DEFAULT_LOGTIMESTAMPS = true; | ||||
extern bool fLogIPs; | extern bool fLogIPs; | ||||
extern const char *const DEFAULT_DEBUGLOGFILE; | |||||
namespace BCLog { | namespace BCLog { | ||||
enum LogFlags : uint32_t { | enum LogFlags : uint32_t { | ||||
NONE = 0, | NONE = 0, | ||||
NET = (1 << 0), | NET = (1 << 0), | ||||
TOR = (1 << 1), | TOR = (1 << 1), | ||||
MEMPOOL = (1 << 2), | MEMPOOL = (1 << 2), | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | public: | ||||
std::atomic<bool> m_reopen_file{false}; | std::atomic<bool> m_reopen_file{false}; | ||||
~Logger(); | ~Logger(); | ||||
/** Send a string to the log output */ | /** Send a string to the log output */ | ||||
int LogPrintStr(const std::string &str); | int LogPrintStr(const std::string &str); | ||||
void OpenDebugLog(); | fs::path GetDebugLogPath(); | ||||
bool OpenDebugLog(); | |||||
void ShrinkDebugFile(); | void ShrinkDebugFile(); | ||||
void EnableCategory(LogFlags category); | void EnableCategory(LogFlags category); | ||||
bool EnableCategory(const std::string &str); | bool EnableCategory(const std::string &str); | ||||
void DisableCategory(LogFlags category); | void DisableCategory(LogFlags category); | ||||
bool DisableCategory(const std::string &str); | bool DisableCategory(const std::string &str); | ||||
/** Return true if log accepts specified category */ | /** Return true if log accepts specified category */ | ||||
Show All 38 Lines |