all repos — mgba @ ab44084236a244751d4ecd8e6403d58fb7c38de2

mGBA Game Boy Advance Emulator

Core: Get thread log level working again
Jeffrey Pfau jeffrey@endrift.com
Wed, 17 Feb 2016 21:10:21 -0800
commit

ab44084236a244751d4ecd8e6403d58fb7c38de2

parent

6eefdfff0317e38a6640678a8f5317a8c13ae2f1

2 files changed, 5 insertions(+), 7 deletions(-)

jump to
M src/core/thread.csrc/core/thread.c

@@ -164,6 +164,7 @@

bool mCoreThreadStart(struct mCoreThread* threadContext) { threadContext->state = THREAD_INITIALIZED; threadContext->logger.p = threadContext; + threadContext->logLevel = threadContext->core->opts.logLevel; if (!threadContext->sync.fpsTarget) { threadContext->sync.fpsTarget = _defaultFPSTarget;

@@ -408,6 +409,10 @@ #endif

static void _mCoreLog(struct mLogger* logger, int category, enum mLogLevel level, const char* format, va_list args) { UNUSED(logger); + struct mCoreThread* thread = mCoreThreadGet(); + if (thread && !(thread->logLevel & level)) { + return; + } printf("%s: ", mLogCategoryName(category)); vprintf(format, args); printf("\n");
M src/debugger/debugger.hsrc/debugger/debugger.h

@@ -81,13 +81,6 @@ };

}; }; -enum DebuggerLogLevel { - DEBUGGER_LOG_DEBUG = 0x01, - DEBUGGER_LOG_INFO = 0x02, - DEBUGGER_LOG_WARN = 0x04, - DEBUGGER_LOG_ERROR = 0x08 -}; - struct Debugger { struct mCPUComponent d; enum DebuggerState state;