diff options
-rw-r--r-- | alc/alc.cpp | 6 | ||||
-rw-r--r-- | alc/logging.h | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index a870a565..2b9c9ce6 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -976,7 +976,7 @@ void alc_initconfig(void) if(auto loglevel = al::getenv("ALSOFT_LOGLEVEL")) { long lvl = strtol(loglevel->c_str(), nullptr, 0); - if(lvl >= NoLog && lvl <= LogRef) + if(lvl >= static_cast<long>(LogLevel::Disable) && lvl <= static_cast<long>(LogLevel::Ref)) gLogLevel = static_cast<LogLevel>(lvl); } @@ -1272,9 +1272,9 @@ int RTPrioLevel{1}; FILE *gLogFile{stderr}; #ifdef _DEBUG -LogLevel gLogLevel{LogWarning}; +LogLevel gLogLevel{LogLevel::Warning}; #else -LogLevel gLogLevel{LogError}; +LogLevel gLogLevel{LogLevel::Error}; #endif /************************************************ diff --git a/alc/logging.h b/alc/logging.h index 1077f08f..77593779 100644 --- a/alc/logging.h +++ b/alc/logging.h @@ -22,29 +22,29 @@ extern FILE *gLogFile; #define LOG_ANDROID(T, ...) ((void)0) #endif -enum LogLevel { - NoLog, - LogError, - LogWarning, - LogTrace, - LogRef +enum class LogLevel { + Disable, + Error, + Warning, + Trace, + Ref }; extern LogLevel gLogLevel; #define TRACE(...) do { \ - if UNLIKELY(gLogLevel >= LogTrace) \ + if UNLIKELY(gLogLevel >= LogLevel::Trace) \ AL_PRINT(gLogFile, "AL lib: (II) " __VA_ARGS__); \ LOG_ANDROID(ANDROID_LOG_DEBUG, __VA_ARGS__); \ } while(0) #define WARN(...) do { \ - if UNLIKELY(gLogLevel >= LogWarning) \ + if UNLIKELY(gLogLevel >= LogLevel::Warning) \ AL_PRINT(gLogFile, "AL lib: (WW) " __VA_ARGS__); \ LOG_ANDROID(ANDROID_LOG_WARN, __VA_ARGS__); \ } while(0) #define ERR(...) do { \ - if UNLIKELY(gLogLevel >= LogError) \ + if UNLIKELY(gLogLevel >= LogLevel::Error) \ AL_PRINT(gLogFile, "AL lib: (EE) " __VA_ARGS__); \ LOG_ANDROID(ANDROID_LOG_ERROR, __VA_ARGS__); \ } while(0) |