diff options
author | Chris Robinson <[email protected]> | 2023-01-16 22:15:03 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-01-16 22:15:03 -0800 |
commit | bb751ebc4421789219cb05ca8afa4203fb1d1ed7 (patch) | |
tree | 571d1acba76fe32da879138a11e749b7fd770b9f /core | |
parent | 3d00147b99d4996f322ff231a7e0e7d9aff86f60 (diff) |
Fix debug logging on Windows non-release buuilds
And skip logging for appropriate log levels on Windows release builds.
Diffstat (limited to 'core')
-rw-r--r-- | core/logging.cpp | 6 | ||||
-rw-r--r-- | core/logging.h | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/core/logging.cpp b/core/logging.cpp index 69cb92b5..ec53e5f6 100644 --- a/core/logging.cpp +++ b/core/logging.cpp @@ -21,10 +21,6 @@ void al_print(LogLevel level, FILE *logfile, const char *fmt, ...) { -#if (defined(_WIN32) && defined(NDEBUG)) || !defined(__ANDROID__) - if(gLogLevel < level) [[likely]] - return; -#endif /* 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 * span. @@ -67,7 +63,7 @@ void al_print(LogLevel level, FILE *logfile, const char *fmt, ...) fputs(str, logfile); fflush(logfile); } -#if defined(_WIN32) && defined(NDEBUG) +#if defined(_WIN32) && !defined(NDEBUG) /* OutputDebugStringW has no 'level' property to distinguish between * informational, warning, or error debug messages. So only print them for * non-Release builds. diff --git a/core/logging.h b/core/logging.h index 2853afbd..c729ef4e 100644 --- a/core/logging.h +++ b/core/logging.h @@ -23,7 +23,7 @@ extern FILE *gLogFile; #endif void al_print(LogLevel level, FILE *logfile, const char *fmt, ...); -#if !defined(_WIN32) && !defined(__ANDROID__) +#if (!defined(_WIN32) || defined(NDEBUG)) && !defined(__ANDROID__) #define TRACE(...) do { \ if(gLogLevel >= LogLevel::Trace) [[unlikely]] \ al_print(LogLevel::Trace, gLogFile, __VA_ARGS__); \ |