Change log level to mask
Jeffrey Pfau jeffrey@endrift.com
Mon, 30 Sep 2013 01:48:41 -0700
2 files changed,
10 insertions(+),
9 deletions(-)
M
src/gba/gba.c
→
src/gba/gba.c
@@ -51,7 +51,7 @@
gba->springIRQ = 0; gba->keySource = 0; - gba->logLevel = GBA_LOG_INFO; + gba->logLevel = GBA_LOG_INFO | GBA_LOG_WARN | GBA_LOG_ERROR; ARMReset(&gba->cpu); }@@ -375,7 +375,7 @@ if (threadContext) {
gba = threadContext->gba; } } - if (gba && level < gba->logLevel) { + if (gba && !(level & gba->logLevel)) { return; } va_list args;
M
src/gba/gba.h
→
src/gba/gba.h
@@ -30,12 +30,13 @@ GBA_OUT_OF_MEMORY = -1
}; enum GBALogLevel { - GBA_LOG_STUB, - GBA_LOG_DEBUG, - GBA_LOG_GAME_ERROR, - GBA_LOG_INFO, - GBA_LOG_WARN, - GBA_LOG_ERROR, + GBA_LOG_STUB = 0x01, + GBA_LOG_DEBUG = 0x02, + GBA_LOG_INFO = 0x04, + GBA_LOG_WARN = 0x08, + GBA_LOG_ERROR = 0x10, + + GBA_LOG_GAME_ERROR = 0x100 }; enum GBAKey {@@ -85,7 +86,7 @@ const char* activeFile;
const char* savefile; enum GBAError errno; const char* errstr; - enum GBALogLevel logLevel; + int logLevel; }; void GBAInit(struct GBA* gba);