diff --git a/.gitignore b/.gitignore index 1dc3436c..25f272c9 100644 --- a/.gitignore +++ b/.gitignore @@ -93,3 +93,6 @@ cmake-build-*/ # macos *.DS_store *.xcodeproj/ +/.vs +/out/build +/CMakeSettings.json diff --git a/include/spdlog/common-inl.h b/include/spdlog/common-inl.h index 59c0284c..413c8f1e 100644 --- a/include/spdlog/common-inl.h +++ b/include/spdlog/common-inl.h @@ -14,7 +14,7 @@ namespace spdlog { SPDLOG_INLINE spdlog::log_level level_from_str(const std::string &name) noexcept { - const auto *it = std::find(std::begin(level_string_views), std::end(level_string_views), name); + auto it = std::find(std::begin(level_string_views), std::end(level_string_views), name); if (it != std::end(level_string_views)) return static_cast(std::distance(std::begin(level_string_views), it)); diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index 495ea46e..6f26c3d8 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -24,14 +24,14 @@ SPDLOG_INLINE wincolor_sink::wincolor_sink(void *out_handle, color set_color_mode_impl(mode); // set level colors - colors_[log_level::trace] = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; // white - colors_[log_level::debug] = FOREGROUND_GREEN | FOREGROUND_BLUE; // cyan - colors_[log_level::info] = FOREGROUND_GREEN; // green - colors_[spdlog::log_level::warn] = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY; // intense yellow - colors_[log_level::err] = FOREGROUND_RED | FOREGROUND_INTENSITY; // intense red - colors_[log_level::critical] = + colors_.at(to_size_t(log_level::trace)) = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; // white + colors_.at(to_size_t(log_level::debug)) = FOREGROUND_GREEN | FOREGROUND_BLUE; // cyan + colors_.at(to_size_t(log_level::info)) = FOREGROUND_GREEN; // green + colors_.at(to_size_t(spdlog::log_level::warn)) = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY; // intense yellow + colors_.at(to_size_t(log_level::err)) = FOREGROUND_RED | FOREGROUND_INTENSITY; // intense red + colors_.at(to_size_t(log_level::critical)) = BACKGROUND_RED | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY; // intense white on red background - colors_[log_level::off] = 0; + colors_.at(to_size_t(log_level::off)) = 0; } template diff --git a/include/spdlog/sinks/wincolor_sink.h b/include/spdlog/sinks/wincolor_sink.h index 1ab9a5ed..78a9d373 100644 --- a/include/spdlog/sinks/wincolor_sink.h +++ b/include/spdlog/sinks/wincolor_sink.h @@ -44,7 +44,7 @@ protected: mutex_t &mutex_; bool should_do_colors_; std::unique_ptr formatter_; - std::array colors_; + std::array colors_; // set foreground color and return the orig console attributes (for resetting later) std::uint16_t set_foreground_color_(std::uint16_t attribs);