diff options
Diffstat (limited to 'core/logging.cpp')
-rw-r--r-- | core/logging.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/logging.cpp b/core/logging.cpp index 34385cf4..b6248514 100644 --- a/core/logging.cpp +++ b/core/logging.cpp @@ -19,7 +19,16 @@ #include <android/log.h> #endif -void al_print(LogLevel level, FILE *logfile, const char *fmt, ...) + +FILE *gLogFile{stderr}; +#ifdef _DEBUG +LogLevel gLogLevel{LogLevel::Warning}; +#else +LogLevel gLogLevel{LogLevel::Error}; +#endif + + +void al_print(LogLevel level, const char *fmt, ...) { /* Kind of ugly since string literals are const char arrays with a size * that includes the null terminator, which we want to exclude from the @@ -60,6 +69,7 @@ void al_print(LogLevel level, FILE *logfile, const char *fmt, ...) if(gLogLevel >= level) { + auto logfile = gLogFile; fputs(str, logfile); fflush(logfile); } |