mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 01:51:38 +08:00
optimize wincolor_sink to use array instead of map to find color codes
This commit is contained in:
parent
695912c7cf
commit
4b7c05903b
@ -11,7 +11,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <array>
|
||||||
#include <wincon.h>
|
#include <wincon.h>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
@ -52,7 +52,7 @@ protected:
|
|||||||
bool in_console_;
|
bool in_console_;
|
||||||
bool should_do_colors_;
|
bool should_do_colors_;
|
||||||
std::unique_ptr<spdlog::formatter> formatter_;
|
std::unique_ptr<spdlog::formatter> formatter_;
|
||||||
std::unordered_map<level::level_enum, WORD, level::level_hasher> colors_;
|
std::array<WORD , level::n_levels> colors_;
|
||||||
|
|
||||||
// set foreground color and return the orig console attributes (for resetting later)
|
// set foreground color and return the orig console attributes (for resetting later)
|
||||||
WORD set_foreground_color_(WORD attribs);
|
WORD set_foreground_color_(WORD attribs);
|
||||||
|
Loading…
Reference in New Issue
Block a user