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);
threadContext->gba = &gba;
gba.sync = &threadContext->sync;
gba.logLevel = threadContext->logLevel;
#ifdef USE_PTHREADS
pthread_setspecific(_contextKey, threadContext);
#else
@ -169,6 +170,7 @@ void GBAMapOptionsToContext(struct StartupOptions* opts, struct GBAThread* threa
threadContext->fname = opts->fname;
threadContext->biosFd = opts->biosFd;
threadContext->frameskip = opts->frameskip;
threadContext->logLevel = opts->logLevel;
threadContext->rewindBufferCapacity = opts->rewindBufferCapacity;
threadContext->rewindBufferInterval = opts->rewindBufferInterval;
}

View File

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

View File

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

View File

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