mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
renamed level::to_str() to level::to_c_str()
This commit is contained in:
parent
1f801828a5
commit
1d9e2304be
@ -94,7 +94,7 @@ static const char *level_names[] SPDLOG_LEVEL_NAMES;
|
||||
|
||||
static const char *short_level_names[]{"T", "D", "I", "W", "E", "C", "O"};
|
||||
|
||||
inline const char *to_str(spdlog::level::level_enum l)
|
||||
inline const char *to_c_str(spdlog::level::level_enum l)
|
||||
{
|
||||
return level_names[l];
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ namespace details {
|
||||
namespace fmt_helper {
|
||||
inline void append_str(const std::string &str, fmt::memory_buffer &dest)
|
||||
{
|
||||
const char *str_ptr = str.data();
|
||||
auto *str_ptr = str.data();
|
||||
dest.append(str_ptr, str_ptr + str.size());
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ class level_formatter : public flag_formatter
|
||||
{
|
||||
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
||||
{
|
||||
fmt_helper::append_c_str(level::to_str(msg.level), dest);
|
||||
fmt_helper::append_c_str(level::to_c_str(msg.level), dest);
|
||||
}
|
||||
};
|
||||
|
||||
@ -390,7 +390,7 @@ class i_formatter SPDLOG_FINAL : public flag_formatter
|
||||
{
|
||||
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
||||
{
|
||||
// fmt::format_to(dest, "{:06}", msg.msg_id);
|
||||
|
||||
fmt_helper::pad6(msg.msg_id, dest);
|
||||
}
|
||||
};
|
||||
@ -509,7 +509,7 @@ class full_formatter SPDLOG_FINAL : public flag_formatter
|
||||
dest.push_back('[');
|
||||
// wrap the level name with color
|
||||
msg.color_range_start = dest.size();
|
||||
fmt_helper::append_c_str(level::to_str(msg.level), dest);
|
||||
fmt_helper::append_c_str(level::to_c_str(msg.level), dest);
|
||||
msg.color_range_end = dest.size();
|
||||
dest.push_back(']');
|
||||
dest.push_back(' ');
|
||||
|
Loading…
Reference in New Issue
Block a user