From 47890657003fdbdada4590d025ac04add6c96a66 Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 13 Jan 2024 09:32:01 +0200 Subject: [PATCH] Remove custom level names from macro --- include/spdlog/common.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/include/spdlog/common.h b/include/spdlog/common.h index 205c124c..a9eab24d 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -156,23 +156,14 @@ using atomic_level_t = details::null_atomic; using atomic_level_t = std::atomic; #endif -#if !defined(SPDLOG_LEVEL_NAMES) - #define SPDLOG_LEVEL_NAMES \ - { "trace", "debug", "info", "warning", "error", "critical", "off" } -#endif - -#if !defined(SPDLOG_SHORT_LEVEL_NAMES) - #define SPDLOG_SHORT_LEVEL_NAMES \ - { "T", "D", "I", "W", "E", "C", "O" } -#endif [[nodiscard]] constexpr size_t level_to_number(level lvl) noexcept { return static_cast(lvl); } constexpr auto levels_count = level_to_number(level::n_levels); -constexpr std::array level_string_views SPDLOG_LEVEL_NAMES; -constexpr std::array short_level_names SPDLOG_SHORT_LEVEL_NAMES; +constexpr std::array level_string_views { "trace", "debug", "info", "warning", "error", "critical", "off" }; +constexpr std::array short_level_names { "T", "D", "I", "W", "E", "C", "O" }; [[nodiscard]] constexpr string_view_t to_string_view(spdlog::level lvl) noexcept { return level_string_views.at(level_to_number(lvl));