Core: Get thread log level working again
Jeffrey Pfau jeffrey@endrift.com
Wed, 17 Feb 2016 21:10:21 -0800
2 files changed,
5 insertions(+),
7 deletions(-)
M
src/core/thread.c
→
src/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.h
→
src/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;