Commit 91264ea2 authored by gabime's avatar gabime

small improvment to formatter

parent e66ee8b7
...@@ -16,8 +16,12 @@ inline void append_str(const std::string &str, fmt::memory_buffer &dest) ...@@ -16,8 +16,12 @@ inline void append_str(const std::string &str, fmt::memory_buffer &dest)
inline void append_c_str(const char *c_str, fmt::memory_buffer &dest) inline void append_c_str(const char *c_str, fmt::memory_buffer &dest)
{ {
auto str_size = strlen(c_str); char ch;
dest.append(c_str, c_str + str_size); while ((ch = *c_str) != '\0')
{
dest.push_back(ch);
++c_str;
}
} }
inline void append_buf(const fmt::memory_buffer &buf, fmt::memory_buffer &dest) inline void append_buf(const fmt::memory_buffer &buf, fmt::memory_buffer &dest)
......
...@@ -506,7 +506,6 @@ class full_formatter SPDLOG_FINAL : public flag_formatter ...@@ -506,7 +506,6 @@ class full_formatter SPDLOG_FINAL : public flag_formatter
#endif #endif
dest.push_back('['); dest.push_back('[');
// wrap the level name with color // wrap the level name with color
msg.color_range_start = dest.size(); msg.color_range_start = dest.size();
fmt_helper::append_c_str(level::to_str(msg.level), dest); fmt_helper::append_c_str(level::to_str(msg.level), dest);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment