renamed level::to_str() to level::to_c_str()

This commit is contained in:
gabime 2018-07-04 02:08:28 +03:00
parent 1f801828a5
commit 1d9e2304be
3 changed files with 5 additions and 5 deletions

View File

@ -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];
}

View File

@ -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());
}

View File

@ -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(' ');