mirror of
https://github.com/gabime/spdlog.git
synced 2025-11-16 09:28:56 +08:00
Switch to vformat_to
Drive-by: reduce the amount of occurences of #ifdef SPDLOG_USE_STD_FORMAT
This commit is contained in:
@@ -30,11 +30,8 @@ protected:
|
||||
{
|
||||
memory_buf_t formatted;
|
||||
base_sink<Mutex>::formatter_->format(msg, formatted);
|
||||
# ifdef SPDLOG_USE_STD_FORMAT
|
||||
OutputDebugStringA(formatted.c_str());
|
||||
# else
|
||||
OutputDebugStringA(fmt::to_string(formatted).c_str());
|
||||
# endif
|
||||
formatted.push_back('\0'); // add a null terminator for OutputDebugStringA
|
||||
OutputDebugStringA(formatted.data());
|
||||
}
|
||||
|
||||
void flush_() override {}
|
||||
|
||||
@@ -50,11 +50,7 @@ public:
|
||||
{
|
||||
memory_buf_t formatted;
|
||||
base_sink<Mutex>::formatter_->format(q_.at(i), formatted);
|
||||
#ifdef SPDLOG_USE_STD_FORMAT
|
||||
ret.push_back(std::move(formatted));
|
||||
#else
|
||||
ret.push_back(fmt::to_string(formatted));
|
||||
#endif
|
||||
ret.push_back(fmt_helper::to_string(formatted));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user