mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-28 17:19:34 +08:00
Use fmt::string_view when logging a C string to avoid unnecessary copy
This commit is contained in:
@@ -401,7 +401,7 @@ class v_formatter final : public flag_formatter
|
||||
{
|
||||
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
||||
{
|
||||
fmt_helper::append_buf(msg.raw, dest);
|
||||
fmt_helper::append_msg(msg, dest);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -524,7 +524,7 @@ class full_formatter final : public flag_formatter
|
||||
msg.color_range_end = dest.size();
|
||||
dest.push_back(']');
|
||||
dest.push_back(' ');
|
||||
fmt_helper::append_buf(msg.raw, dest);
|
||||
fmt_helper::append_msg(msg, dest);
|
||||
}
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user