GBA: Allow GBAThread to override GBA object logLevel
Jeffrey Pfau jeffrey@endrift.com
Thu, 01 Jan 2015 16:05:07 -0800
1 files changed,
8 insertions(+),
4 deletions(-)
jump to
M
src/gba/gba.c
→
src/gba/gba.c
@@ -607,13 +607,17 @@ }
static void _GBAVLog(struct GBA* gba, enum GBALogLevel level, const char* format, va_list args) { struct GBAThread* threadContext = GBAThreadGetContext(); + enum GBALogLevel logLevel = -1; + + if (gba) { + logLevel = gba->logLevel; + } + if (threadContext) { - if (!gba) { - gba = threadContext->gba; - } + logLevel = threadContext->logLevel; } - if (gba && !(level & gba->logLevel) && level != GBA_LOG_FATAL) { + if (!(level & logLevel) && level != GBA_LOG_FATAL) { return; }