MCPcopy Create free account
hub / github.com/ElementsProject/elements / LogPrintf_

Function LogPrintf_

src/logging.h:259–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257
258template <typename... Args>
259static inline void LogPrintf_(const std::string& logging_function, const std::string& source_file, const int source_line, const BCLog::LogFlags flag, const BCLog::Level level, const char* fmt, const Args&... args)
260{
261 if (LogInstance().Enabled()) {
262 std::string log_msg;
263 try {
264 log_msg = tfm::format(fmt, args...);
265 } catch (tinyformat::format_error& fmterr) {
266 /* Original format string will have newline so don't add one here */
267 log_msg = "Error \"" + std::string(fmterr.what()) + "\" while formatting log message: " + fmt;
268 }
269
270 const SourceLocation source_location{source_file, source_line};
271 LogInstance().LogPrintStr(log_msg, logging_function, source_location, flag, level);
272 }
273}
274
275
276#define LogPrintLevel_(category, level, ...) LogPrintf_(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)

Callers 1

BOOST_FIXTURE_TEST_CASEFunction · 0.85

Calls 3

EnabledMethod · 0.80
LogPrintStrMethod · 0.80
formatFunction · 0.70

Tested by 1

BOOST_FIXTURE_TEST_CASEFunction · 0.68