mirror of https://github.com/mgba-emu/mgba.git
Add (currently undocumented) command line flag for setting logging level
This commit is contained in:
parent
80d1764e6c
commit
678c5465ff
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -58,6 +58,7 @@ struct GBAThread {
|
|||
enum ThreadState savedState;
|
||||
|
||||
GBALogHandler logHandler;
|
||||
int logLevel;
|
||||
ThreadCallback startCallback;
|
||||
ThreadCallback cleanCallback;
|
||||
ThreadCallback frameCallback;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -18,6 +18,7 @@ struct StartupOptions {
|
|||
int fd;
|
||||
const char* fname;
|
||||
int biosFd;
|
||||
int logLevel;
|
||||
int frameskip;
|
||||
int rewindBufferCapacity;
|
||||
int rewindBufferInterval;
|
||||
|
|
Loading…
Reference in New Issue