Update common.h

This commit is contained in:
Gabi Melman 2023-09-26 01:43:48 +03:00 committed by GitHub
parent 6dffd7c6e8
commit 7ac740a029
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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