Add (currently undocumented) command line flag for setting logging level

This commit is contained in:
Jeffrey Pfau 2014-07-04 18:43:07 -07:00
parent 80d1764e6c
commit 678c5465ff
4 changed files with 8 additions and 1 deletions

View File

@ -75,6 +75,7 @@ static THREAD_ENTRY _GBAThreadRun(void* context) {
ARMReset(&cpu); ARMReset(&cpu);
threadContext->gba = &gba; threadContext->gba = &gba;
gba.sync = &threadContext->sync; gba.sync = &threadContext->sync;
gba.logLevel = threadContext->logLevel;
#ifdef USE_PTHREADS #ifdef USE_PTHREADS
pthread_setspecific(_contextKey, threadContext); pthread_setspecific(_contextKey, threadContext);
#else #else
@ -169,6 +170,7 @@ void GBAMapOptionsToContext(struct StartupOptions* opts, struct GBAThread* threa
threadContext->fname = opts->fname; threadContext->fname = opts->fname;
threadContext->biosFd = opts->biosFd; threadContext->biosFd = opts->biosFd;
threadContext->frameskip = opts->frameskip; threadContext->frameskip = opts->frameskip;
threadContext->logLevel = opts->logLevel;
threadContext->rewindBufferCapacity = opts->rewindBufferCapacity; threadContext->rewindBufferCapacity = opts->rewindBufferCapacity;
threadContext->rewindBufferInterval = opts->rewindBufferInterval; threadContext->rewindBufferInterval = opts->rewindBufferInterval;
} }

View File

@ -58,6 +58,7 @@ struct GBAThread {
enum ThreadState savedState; enum ThreadState savedState;
GBALogHandler logHandler; GBALogHandler logHandler;
int logLevel;
ThreadCallback startCallback; ThreadCallback startCallback;
ThreadCallback cleanCallback; ThreadCallback cleanCallback;
ThreadCallback frameCallback; ThreadCallback frameCallback;

View File

@ -44,7 +44,7 @@ int parseCommandArgs(struct StartupOptions* opts, int argc, char* const* argv, s
int ch; int ch;
char options[64] = char options[64] =
"b:s:" "b:l:s:"
#ifdef USE_CLI_DEBUGGER #ifdef USE_CLI_DEBUGGER
"d" "d"
#endif #endif
@ -77,6 +77,9 @@ int parseCommandArgs(struct StartupOptions* opts, int argc, char* const* argv, s
opts->debuggerType = DEBUGGER_GDB; opts->debuggerType = DEBUGGER_GDB;
break; break;
#endif #endif
case 'l':
opts->logLevel = atoi(optarg);
break;
case 's': case 's':
opts->frameskip = atoi(optarg); opts->frameskip = atoi(optarg);
break; break;

View File

@ -18,6 +18,7 @@ struct StartupOptions {
int fd; int fd;
const char* fname; const char* fname;
int biosFd; int biosFd;
int logLevel;
int frameskip; int frameskip;
int rewindBufferCapacity; int rewindBufferCapacity;
int rewindBufferInterval; int rewindBufferInterval;