mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Update common.h
This commit is contained in:
parent
6dffd7c6e8
commit
7ac740a029
@ -123,7 +123,6 @@ using format_string_t = std::string_view;
|
||||
#define SPDLOG_BUF_TO_STRING(x) x
|
||||
#else // use fmt lib instead of std::format
|
||||
namespace fmt_lib = fmt;
|
||||
|
||||
using string_view_t = fmt::basic_string_view<char>;
|
||||
using memory_buf_t = fmt::basic_memory_buffer<char, 250>;
|
||||
template <typename... Args>
|
||||
@ -182,13 +181,13 @@ using atomic_level_t = std::atomic<level>;
|
||||
}
|
||||
constexpr auto levels_count = level_to_number(level::n_levels);
|
||||
constexpr std::array<string_view_t, levels_count> level_string_views SPDLOG_LEVEL_NAMES;
|
||||
constexpr std::array<const char *, levels_count> short_level_names SPDLOG_SHORT_LEVEL_NAMES;
|
||||
constexpr std::array<string_view_t, levels_count> short_level_names SPDLOG_SHORT_LEVEL_NAMES;
|
||||
|
||||
[[nodiscard]] constexpr string_view_t to_string_view(spdlog::level lvl) noexcept {
|
||||
return level_string_views.at(level_to_number(lvl));
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr const char *to_short_c_str(spdlog::level lvl) noexcept {
|
||||
[[nodiscard]] constexpr const char *to_short_string_view(spdlog::level lvl) noexcept {
|
||||
return short_level_names.at(level_to_number(lvl));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user