mirror of https://github.com/mgba-emu/mgba.git
Core: Get thread log level working again
This commit is contained in:
parent
6eefdfff03
commit
ab44084236
|
@ -164,6 +164,7 @@ static THREAD_ENTRY _mCoreThreadRun(void* context) {
|
||||||
bool mCoreThreadStart(struct mCoreThread* threadContext) {
|
bool mCoreThreadStart(struct mCoreThread* threadContext) {
|
||||||
threadContext->state = THREAD_INITIALIZED;
|
threadContext->state = THREAD_INITIALIZED;
|
||||||
threadContext->logger.p = threadContext;
|
threadContext->logger.p = threadContext;
|
||||||
|
threadContext->logLevel = threadContext->core->opts.logLevel;
|
||||||
|
|
||||||
if (!threadContext->sync.fpsTarget) {
|
if (!threadContext->sync.fpsTarget) {
|
||||||
threadContext->sync.fpsTarget = _defaultFPSTarget;
|
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) {
|
static void _mCoreLog(struct mLogger* logger, int category, enum mLogLevel level, const char* format, va_list args) {
|
||||||
UNUSED(logger);
|
UNUSED(logger);
|
||||||
|
struct mCoreThread* thread = mCoreThreadGet();
|
||||||
|
if (thread && !(thread->logLevel & level)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
printf("%s: ", mLogCategoryName(category));
|
printf("%s: ", mLogCategoryName(category));
|
||||||
vprintf(format, args);
|
vprintf(format, args);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
|
@ -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 Debugger {
|
||||||
struct mCPUComponent d;
|
struct mCPUComponent d;
|
||||||
enum DebuggerState state;
|
enum DebuggerState state;
|
||||||
|
|
Loading…
Reference in New Issue