mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Fix Windows ERROR macro collision in logger
This commit is contained in:
parent
e1614d55a2
commit
35384b2c52
3 changed files with 8 additions and 4 deletions
|
|
@ -26,6 +26,10 @@ enum class LogLevel {
|
|||
FATAL
|
||||
};
|
||||
|
||||
// Avoid direct token use of `ERROR` at call sites because Windows headers
|
||||
// define `ERROR` as a macro.
|
||||
inline constexpr LogLevel kLogLevelError = LogLevel::ERROR;
|
||||
|
||||
class Logger {
|
||||
public:
|
||||
static Logger& getInstance();
|
||||
|
|
@ -128,7 +132,7 @@ private:
|
|||
|
||||
#define LOG_ERROR(...) do { \
|
||||
auto& _wowee_logger = wowee::core::Logger::getInstance(); \
|
||||
if (_wowee_logger.shouldLog(wowee::core::LogLevel::ERROR)) { \
|
||||
if (_wowee_logger.shouldLog(wowee::core::kLogLevelError)) { \
|
||||
_wowee_logger.error(__VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue