Win32: Implement "-d" command-line switch. It didn't do anything, previously.

Also added a helper func to set all log levels at once. Should be handy if we clean up the logging channels screen.
This commit is contained in:
The Dax 2014-03-31 22:44:05 -04:00
parent e6b2c66640
commit 3259b61cf2
2 changed files with 14 additions and 1 deletions

View File

@ -127,6 +127,12 @@ public:
log_[type]->SetLevel(level);
}
void SetAllLogLevels(LogTypes::LOG_LEVELS level) {
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i) {
log_[i]->SetLevel(level);
}
}
void SetEnable(LogTypes::LOG_TYPE type, bool enable) {
log_[type]->SetEnable(enable);
}

View File

@ -310,6 +310,8 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
g_Config.SetDefaultPath(GetSysDirectory(DIRECTORY_SYSTEM));
g_Config.Load(configFilename, controlsConfigFilename);
bool debugLogLevel = false;
// The rest is handled in NativeInit().
for (int i = 1; i < __argc; ++i)
{
@ -328,6 +330,9 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
g_Config.bAutoRun = false;
g_Config.bSaveSettings = false;
break;
case 'd':
debugLogLevel = true;
break;
}
if (!strncmp(__argv[i], "--fullscreen", strlen("--fullscreen")))
@ -351,7 +356,9 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
// - The -l switch is expected to show the log console, REGARDLESS of config settings.
// - It should be possible to log to a file without showing the console.
LogManager::GetInstance()->GetConsoleListener()->Init(showLog, 150, 120, "PPSSPP Debug Console");
if (debugLogLevel)
LogManager::GetInstance()->SetAllLogLevels(LogTypes::LDEBUG);
//Windows, API init stuff
INITCOMMONCONTROLSEX comm;