Fix issue #629
This commit is contained in:
		
							parent
							
								
									1dfc8282df
								
							
						
					
					
						commit
						5ab033fba5
					
				@ -98,6 +98,8 @@ inline const char* to_short_str(spdlog::level::level_enum l)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    return short_level_names[l];
 | 
					    return short_level_names[l];
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					using level_hasher = std::hash<int>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} //level
 | 
					} //level
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -104,7 +104,7 @@ protected:
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    FILE* target_file_;
 | 
					    FILE* target_file_;
 | 
				
			||||||
    bool should_do_colors_;
 | 
					    bool should_do_colors_;
 | 
				
			||||||
    std::unordered_map<level::level_enum, std::string> colors_;
 | 
					    std::unordered_map<level::level_enum, std::string, level::level_hasher> colors_;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -11,7 +11,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <mutex>
 | 
					#include <mutex>
 | 
				
			||||||
#include <string>
 | 
					#include <string>
 | 
				
			||||||
#include <map>
 | 
					#include <unordered_map>
 | 
				
			||||||
#include <wincon.h>
 | 
					#include <wincon.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace spdlog
 | 
					namespace spdlog
 | 
				
			||||||
@ -73,7 +73,7 @@ protected:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
    HANDLE out_handle_;
 | 
					    HANDLE out_handle_;
 | 
				
			||||||
    std::map<level::level_enum, WORD> colors_;
 | 
					    std::unordered_map<level::level_enum, WORD, level::level_hasher> colors_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // set color and return the orig console attributes (for resetting later)
 | 
					    // set color and return the orig console attributes (for resetting later)
 | 
				
			||||||
    WORD set_console_attribs(WORD attribs)
 | 
					    WORD set_console_attribs(WORD attribs)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user