mirror of https://github.com/mgba-emu/mgba.git
GBA: Allow GBAThread to override GBA object logLevel
This commit is contained in:
parent
b51710e92f
commit
642ba374e7
|
@ -607,13 +607,17 @@ void GBAHalt(struct GBA* gba) {
|
||||||
|
|
||||||
static void _GBAVLog(struct GBA* gba, enum GBALogLevel level, const char* format, va_list args) {
|
static void _GBAVLog(struct GBA* gba, enum GBALogLevel level, const char* format, va_list args) {
|
||||||
struct GBAThread* threadContext = GBAThreadGetContext();
|
struct GBAThread* threadContext = GBAThreadGetContext();
|
||||||
if (threadContext) {
|
enum GBALogLevel logLevel = -1;
|
||||||
if (!gba) {
|
|
||||||
gba = threadContext->gba;
|
if (gba) {
|
||||||
}
|
logLevel = gba->logLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gba && !(level & gba->logLevel) && level != GBA_LOG_FATAL) {
|
if (threadContext) {
|
||||||
|
logLevel = threadContext->logLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(level & logLevel) && level != GBA_LOG_FATAL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue