pull/479/merge
Amir Rossert 8 years ago committed by GitHub
commit 9cb2dd7ada

@ -67,7 +67,11 @@ inline void spdlog::logger::log(level::level_enum lvl, const char* fmt, const Ar
try
{
details::log_msg log_msg(&_name, lvl);
log_msg.raw.write(fmt, args...);
#ifdef SPDLOG_PRINTF_FORMATTING
log_msg.raw << fmt::sprintf(fmt, args...);
#else
log_msg.raw.write(fmt, args...);
#endif
_sink_it(log_msg);
}
catch (const std::exception &ex)

@ -138,4 +138,14 @@
//
// #define SPDLOG_LEVEL_NAMES { " TRACE", " DEBUG", " INFO",
// " WARNING", " ERROR", "CRITICAL", "OFF" };
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Uncomment to use printf formatting:
// logger->log("Message %d: Hello %s", 1, "world")
//
// Otherwise use the python formatting:
// logger->log("Message {}: Hello {}", 1, "world")
//
// #define SPDLOG_PRINTF_FORMATTING
///////////////////////////////////////////////////////////////////////////////

Loading…
Cancel
Save