Use at() in ansicolor_sink

This commit is contained in:
gabime 2023-06-07 13:21:40 +03:00
parent 95b8ee9b32
commit 31cefdce79

View File

@ -21,20 +21,20 @@ SPDLOG_INLINE ansicolor_sink<ConsoleMutex>::ansicolor_sink(FILE *target_file, co
{
set_color_mode(mode);
colors_[level::trace] = to_string_(white);
colors_[level::debug] = to_string_(cyan);
colors_[level::info] = to_string_(green);
colors_[level::warn] = to_string_(yellow_bold);
colors_[level::err] = to_string_(red_bold);
colors_[level::critical] = to_string_(bold_on_red);
colors_[level::off] = to_string_(reset);
colors_.at(level::trace) = to_string_(white);
colors_.at(level::debug) = to_string_(cyan);
colors_.at(level::info) = to_string_(green);
colors_.at(level::warn) = to_string_(yellow_bold);
colors_.at(level::err) = to_string_(red_bold);
colors_.at(level::critical) = to_string_(bold_on_red);
colors_.at(level::off) = to_string_(reset);
}
template<typename ConsoleMutex>
SPDLOG_INLINE void ansicolor_sink<ConsoleMutex>::set_color(level::level_enum color_level, string_view_t color)
{
std::lock_guard<mutex_t> lock(mutex_);
colors_[static_cast<size_t>(color_level)] = to_string_(color);
colors_.at(static_cast<size_t>(color_level)) = to_string_(color);
}
template<typename ConsoleMutex>