mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 10:31:34 +08:00
Use std::vformat
This commit is contained in:
parent
a3ef3ab7a4
commit
3d5ddea136
@ -321,13 +321,14 @@ protected:
|
|||||||
assert(should_log(lvl));
|
assert(should_log(lvl));
|
||||||
SPDLOG_TRY
|
SPDLOG_TRY
|
||||||
{
|
{
|
||||||
memory_buf_t buf;
|
|
||||||
#ifdef SPDLOG_USE_STD_FORMAT
|
#ifdef SPDLOG_USE_STD_FORMAT
|
||||||
fmt_lib::vformat_to(std::back_inserter(buf), fmt, fmt_lib::make_format_args(args...));
|
auto formatted = std::vformat(fmt, std::make_format_args(args...));
|
||||||
#else
|
sink_it_(details::log_msg(loc, name_, lvl, formatted));
|
||||||
fmt::vformat_to(fmt::appender(buf), fmt, fmt::make_format_args(args...));
|
#else // use {fmt} lib
|
||||||
#endif
|
memory_buf_t buf;
|
||||||
|
fmt::vformat_to(std::back_inserter(buf), fmt, fmt::make_format_args(args...));
|
||||||
sink_it_(details::log_msg(loc, name_, lvl, string_view_t(buf.data(), buf.size())));
|
sink_it_(details::log_msg(loc, name_, lvl, string_view_t(buf.data(), buf.size())));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
SPDLOG_LOGGER_CATCH(loc)
|
SPDLOG_LOGGER_CATCH(loc)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user