6 #ifndef BITCOIN_LOGGING_H 7 #define BITCOIN_LOGGING_H 19 static const bool DEFAULT_LOGTIMEMICROS =
false;
20 static const bool DEFAULT_LOGIPS =
false;
21 static const bool DEFAULT_LOGTIMESTAMPS =
true;
132 template <
typename... Args>
133 static inline void LogPrintf(
const char* fmt,
const Args&... args)
141 log_msg =
"Error \"" + std::string(fmterr.what()) +
"\" while formatting log message: " + fmt;
147 template <
typename... Args>
148 static inline void LogPrint(
const BCLog::LogFlags& category,
const Args&... args)
150 if (LogAcceptCategory((category))) {
155 #endif // BITCOIN_LOGGING_H void EnableCategory(LogFlags flag)
std::vector< CLogCategoryActive > ListActiveLogCategories()
Returns a vector of the active log categories.
std::atomic< bool > m_reopen_file
void LogPrintStr(const std::string &str)
Send a string to the log output.
uint32_t GetCategoryMask() const
void DisableCategory(LogFlags flag)
bool WillLogCategory(LogFlags category) const
std::atomic< uint32_t > m_categories
Log categories bitfield.
std::string ListLogCategories()
Returns a string with the log categories.
std::atomic_bool m_started_new_line
m_started_new_line is a state variable that will suppress printing of the timestamp when multiple cal...
BCLog::Logger *const g_logger
NOTE: the logger instances is leaked on exit.
std::list< std::string > m_msgs_before_open
bool GetLogCategory(BCLog::LogFlags &flag, const std::string &str)
Return true if str parses as a log category and set the flag.
const char *const DEFAULT_DEBUGLOGFILE
bool Enabled() const
Returns whether logs will be written to any output.
std::string LogTimestampStr(const std::string &str)
bool DefaultShrinkDebugFile() const