X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flibgame%2Fmisc.c;h=7b9beacc51ff555ce81431a5da94817037b331bd;hb=6948b28f2469407be9f8439c7d7f74a40038636f;hp=c5067fb9b8e78a3aa0e1e162b4a284d536f21e61;hpb=a99a1803e5097bc598b4c6f73259715da148ab27;p=rocksndiamonds.git diff --git a/src/libgame/misc.c b/src/libgame/misc.c index c5067fb9..7b9beacc 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -293,6 +293,17 @@ static void Log(int log_level, char *mode, char *format, va_list ap) if (log_level < 0 || log_level > LOG_FATAL) return; + if (log_level == LOG_DEBUG) + { + if (!options.debug) + return; + + // if optional debug mode specified, limit debug output accordingly + if (options.debug_mode != NULL && + !strEqual(options.debug_mode, mode)) + return; + } + #if defined(PLATFORM_ANDROID) android_log_prio = (log_level == LOG_DEBUG ? ANDROID_LOG_DEBUG : log_level == LOG_INFO ? ANDROID_LOG_INFO : @@ -340,14 +351,6 @@ void Debug(char *mode, char *format, ...) { va_list ap; - if (!options.debug) - return; - - // if optional debug mode specified, limit debug output accordingly - if (options.debug_mode != NULL && - !strEqual(options.debug_mode, mode)) - return; - va_start(ap, format); Log(LOG_DEBUG, mode, format, ap); va_end(ap);