Don't log everything to the log handler when that log level is disabled

This commit is contained in:
Jeffrey Pfau 2014-10-12 19:43:19 -07:00
parent 4247db81e4
commit 24c826e5b1
1 changed files with 5 additions and 4 deletions

View File

@ -554,16 +554,17 @@ static void _GBAVLog(struct GBA* gba, enum GBALogLevel level, const char* format
if (!gba) {
gba = threadContext->gba;
}
if (threadContext->logHandler) {
threadContext->logHandler(threadContext, level, format, args);
return;
}
}
if (gba && !(level & gba->logLevel) && level != GBA_LOG_FATAL) {
return;
}
if (threadContext && threadContext->logHandler) {
threadContext->logHandler(threadContext, level, format, args);
return;
}
vprintf(format, args);
printf("\n");