mirror of https://github.com/mgba-emu/mgba.git
Test: Make logging configuration work with ROM tester
This commit is contained in:
parent
8997055fc0
commit
325f59f404
|
@ -8,6 +8,7 @@
|
||||||
#include <mgba/core/cheats.h>
|
#include <mgba/core/cheats.h>
|
||||||
#include <mgba/core/config.h>
|
#include <mgba/core/config.h>
|
||||||
#include <mgba/core/core.h>
|
#include <mgba/core/core.h>
|
||||||
|
#include <mgba/core/log.h>
|
||||||
#include <mgba/core/serialize.h>
|
#include <mgba/core/serialize.h>
|
||||||
#ifdef M_CORE_GBA
|
#ifdef M_CORE_GBA
|
||||||
#include <mgba/internal/gba/gba.h>
|
#include <mgba/internal/gba/gba.h>
|
||||||
|
@ -40,6 +41,7 @@ static bool _parseNamedRegister(const char* regStr, unsigned int* oRegister);
|
||||||
|
|
||||||
static bool _dispatchExiting = false;
|
static bool _dispatchExiting = false;
|
||||||
static int _exitCode = 0;
|
static int _exitCode = 0;
|
||||||
|
static struct mStandardLogger _logger;
|
||||||
|
|
||||||
#ifdef M_CORE_GBA
|
#ifdef M_CORE_GBA
|
||||||
static void _romTestSwi3Callback(void* context);
|
static void _romTestSwi3Callback(void* context);
|
||||||
|
@ -102,6 +104,11 @@ int main(int argc, char * argv[]) {
|
||||||
mArgumentsApply(&args, NULL, 0, &core->config);
|
mArgumentsApply(&args, NULL, 0, &core->config);
|
||||||
|
|
||||||
mCoreConfigSetDefaultValue(&core->config, "idleOptimization", "remove");
|
mCoreConfigSetDefaultValue(&core->config, "idleOptimization", "remove");
|
||||||
|
mCoreConfigSetDefaultIntValue(&core->config, "logToStdout", true);
|
||||||
|
|
||||||
|
mStandardLoggerInit(&_logger);
|
||||||
|
mStandardLoggerConfig(&_logger, &core->config);
|
||||||
|
mLogSetDefaultLogger(&_logger.d);
|
||||||
|
|
||||||
bool cleanExit = false;
|
bool cleanExit = false;
|
||||||
struct mCoreCallbacks callbacks = {0};
|
struct mCoreCallbacks callbacks = {0};
|
||||||
|
@ -185,6 +192,7 @@ int main(int argc, char * argv[]) {
|
||||||
|
|
||||||
loadError:
|
loadError:
|
||||||
mArgumentsDeinit(&args);
|
mArgumentsDeinit(&args);
|
||||||
|
mStandardLoggerDeinit(&_logger);
|
||||||
mCoreConfigDeinit(&core->config);
|
mCoreConfigDeinit(&core->config);
|
||||||
core->deinit(core);
|
core->deinit(core);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue