Changeset View
Changeset View
Standalone View
Standalone View
src/logging.h
Show First 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | |||||
bool GetLogCategory(BCLog::LogFlags &flag, const std::string &str); | bool GetLogCategory(BCLog::LogFlags &flag, const std::string &str); | ||||
// Be conservative when using LogPrintf/error or other things which | // Be conservative when using LogPrintf/error or other things which | ||||
// unconditionally log to debug.log! It should not be the case that an inbound | // unconditionally log to debug.log! It should not be the case that an inbound | ||||
// peer can fill up a user's disk with debug.log entries. | // peer can fill up a user's disk with debug.log entries. | ||||
template <typename... Args> | template <typename... Args> | ||||
static inline void | static inline void | ||||
LogPrintf_(const std::string &logging_function, const std::string &source_file, | LogPrintf_(const std::string &logging_function, const std::string &source_file, | ||||
const int source_line, const char *fmt, const Args &... args) { | const int source_line, const char *fmt, const Args &...args) { | ||||
if (LogInstance().Enabled()) { | if (LogInstance().Enabled()) { | ||||
std::string log_msg; | std::string log_msg; | ||||
try { | try { | ||||
log_msg = tfm::format(fmt, args...); | log_msg = tfm::format(fmt, args...); | ||||
} catch (tinyformat::format_error &fmterr) { | } catch (tinyformat::format_error &fmterr) { | ||||
/** | /** | ||||
* Original format string will have newline so don't add one here | * Original format string will have newline so don't add one here | ||||
*/ | */ | ||||
Show All 28 Lines |