Merge pull request #632 from bschindler/wincolor_set_color_public
Make set_color public in wincolor_sink to retain configurability
This commit is contained in:
		@@ -50,6 +50,13 @@ public:
 | 
				
			|||||||
    wincolor_sink(const wincolor_sink& other) = delete;
 | 
					    wincolor_sink(const wincolor_sink& other) = delete;
 | 
				
			||||||
    wincolor_sink& operator=(const wincolor_sink& other) = delete;
 | 
					    wincolor_sink& operator=(const wincolor_sink& other) = delete;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // change the  color for the given level
 | 
				
			||||||
 | 
					    void set_color(level::level_enum level, WORD color)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        std::lock_guard<Mutex> lock(base_sink<Mutex>::_mutex);
 | 
				
			||||||
 | 
					        colors_[level] = color;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
protected:
 | 
					protected:
 | 
				
			||||||
    virtual void _sink_it(const details::log_msg& msg) override
 | 
					    virtual void _sink_it(const details::log_msg& msg) override
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@@ -64,13 +71,6 @@ protected:
 | 
				
			|||||||
        // windows console always flushed?
 | 
					        // windows console always flushed?
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // change the  color for the given level
 | 
					 | 
				
			||||||
    void set_color(level::level_enum level, WORD color)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        std::lock_guard<Mutex> lock(base_sink<Mutex>::_mutex);
 | 
					 | 
				
			||||||
        colors_[level] = color;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
    HANDLE out_handle_;
 | 
					    HANDLE out_handle_;
 | 
				
			||||||
    std::unordered_map<level::level_enum, WORD, level::level_hasher> colors_;
 | 
					    std::unordered_map<level::level_enum, WORD, level::level_hasher> colors_;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user