mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-13 01:10:26 +08:00
small improvment to formatter
This commit is contained in:
parent
e66ee8b710
commit
91264ea2f0
@ -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
|
|||||||
#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);
|
||||||
|
Loading…
Reference in New Issue
Block a user