Core: Get thread log level working again

This commit is contained in:
Jeffrey Pfau 2016-02-17 21:10:21 -08:00
parent 6eefdfff03
commit ab44084236
2 changed files with 5 additions and 7 deletions

View File

@ -164,6 +164,7 @@ static THREAD_ENTRY _mCoreThreadRun(void* context) {
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 @@ struct mCoreThread* mCoreThreadGet(void) {
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");

View File

@ -81,13 +81,6 @@ struct DebuggerEntryInfo {
};
};
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;