diff options
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/alc.cpp | 10 | ||||
-rw-r--r-- | Alc/helpers.cpp | 10 | ||||
-rw-r--r-- | Alc/logging.h | 14 |
3 files changed, 17 insertions, 17 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp index b19ed410..424a0eaa 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -872,11 +872,11 @@ std::recursive_mutex ListLock; /* Mixing thread piority level */ ALint RTPrioLevel; -FILE *LogFile{stderr}; +FILE *gLogFile{stderr}; #ifdef _DEBUG -enum LogLevel LogLevel{LogWarning}; +LogLevel gLogLevel{LogWarning}; #else -enum LogLevel LogLevel{LogError}; +LogLevel gLogLevel{LogError}; #endif /************************************************ @@ -912,7 +912,7 @@ static void alc_initconfig(void) { long lvl = strtol(str, nullptr, 0); if(lvl >= NoLog && lvl <= LogRef) - LogLevel = static_cast<enum LogLevel>(lvl); + gLogLevel = static_cast<LogLevel>(lvl); } str = getenv("ALSOFT_LOGFILE"); @@ -924,7 +924,7 @@ static void alc_initconfig(void) #else FILE *logfile = fopen(str, "wt"); #endif - if(logfile) LogFile = logfile; + if(logfile) gLogFile = logfile; else ERR("Failed to open log file '%s'\n", str); } diff --git a/Alc/helpers.cpp b/Alc/helpers.cpp index 8a2a851d..a46e857f 100644 --- a/Alc/helpers.cpp +++ b/Alc/helpers.cpp @@ -370,8 +370,8 @@ void al_print(const char *type, const char *func, const char *fmt, ...) str[sizeof(str)-1] = 0; std::wstring wstr{utf8_to_wstr(str)}; - fprintf(LogFile, "AL lib: %s %s: %ls", type, func, wstr.c_str()); - fflush(LogFile); + fprintf(gLogFile, "AL lib: %s %s: %ls", type, func, wstr.c_str()); + fflush(gLogFile); } @@ -589,11 +589,11 @@ void al_print(const char *type, const char *func, const char *fmt, ...) va_list ap; va_start(ap, fmt); - fprintf(LogFile, "AL lib: %s %s: ", type, func); - vfprintf(LogFile, fmt, ap); + fprintf(gLogFile, "AL lib: %s %s: ", type, func); + vfprintf(gLogFile, fmt, ap); va_end(ap); - fflush(LogFile); + fflush(gLogFile); } diff --git a/Alc/logging.h b/Alc/logging.h index 2d9f4063..f493d973 100644 --- a/Alc/logging.h +++ b/Alc/logging.h @@ -14,10 +14,10 @@ extern "C" { #endif -extern FILE *LogFile; +extern FILE *gLogFile; #if defined(__GNUC__) && !defined(_WIN32) -#define AL_PRINT(T, MSG, ...) fprintf(LogFile, "AL lib: %s %s: " MSG, T, __FUNCTION__ , ## __VA_ARGS__) +#define AL_PRINT(T, MSG, ...) fprintf(gLogFile, "AL lib: %s %s: " MSG, T, __FUNCTION__ , ## __VA_ARGS__) #else void al_print(const char *type, const char *func, const char *fmt, ...) DECL_FORMAT(printf, 3,4); #define AL_PRINT(T, ...) al_print((T), __FUNCTION__, __VA_ARGS__) @@ -37,27 +37,27 @@ enum LogLevel { LogTrace, LogRef }; -extern enum LogLevel LogLevel; +extern LogLevel gLogLevel; #define TRACEREF(...) do { \ - if(LogLevel >= LogRef) \ + if(gLogLevel >= LogRef) \ AL_PRINT("(--)", __VA_ARGS__); \ } while(0) #define TRACE(...) do { \ - if(LogLevel >= LogTrace) \ + if(gLogLevel >= LogTrace) \ AL_PRINT("(II)", __VA_ARGS__); \ LOG_ANDROID(ANDROID_LOG_DEBUG, __VA_ARGS__); \ } while(0) #define WARN(...) do { \ - if(LogLevel >= LogWarning) \ + if(gLogLevel >= LogWarning) \ AL_PRINT("(WW)", __VA_ARGS__); \ LOG_ANDROID(ANDROID_LOG_WARN, __VA_ARGS__); \ } while(0) #define ERR(...) do { \ - if(LogLevel >= LogError) \ + if(gLogLevel >= LogError) \ AL_PRINT("(EE)", __VA_ARGS__); \ LOG_ANDROID(ANDROID_LOG_ERROR, __VA_ARGS__); \ } while(0) |