mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 10:01:33 +08:00
Replace static_cast with level_to_number in color sinks
This commit is contained in:
parent
9448d74495
commit
73eb6bc1f5
@ -52,7 +52,7 @@ SPDLOG_INLINE void ansicolor_sink<ConsoleMutex>::log(const details::log_msg &msg
|
||||
// before color range
|
||||
print_range_(formatted, 0, msg.color_range_start);
|
||||
// in color range
|
||||
print_ccode_(colors_.at(static_cast<size_t>(msg.log_level)));
|
||||
print_ccode_(colors_.at(level_to_number(msg.log_level)));
|
||||
print_range_(formatted, msg.color_range_start, msg.color_range_end);
|
||||
print_ccode_(reset);
|
||||
// after color range
|
||||
|
@ -45,7 +45,7 @@ template<typename ConsoleMutex>
|
||||
void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::set_color(level level, std::uint16_t color)
|
||||
{
|
||||
std::lock_guard<mutex_t> lock(mutex_);
|
||||
colors_[static_cast<size_t>(level)] = color;
|
||||
colors_[level_to_number(level)] = color;
|
||||
}
|
||||
|
||||
template<typename ConsoleMutex>
|
||||
|
Loading…
Reference in New Issue
Block a user