mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 01:51:38 +08:00
Use at() in ansicolor_sink
This commit is contained in:
parent
95b8ee9b32
commit
31cefdce79
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user