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