Merge pull request #14019 from glebm/fix-log-flags

Fix logging flags
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2021-01-30 18:18:57 +01:00
commit 09b02a8a71
1 file changed
+5
+5
View File
@@ -30,6 +30,7 @@
#include <locale.h>
#include <algorithm>
#include <cstdlib>
#include <memory>
#include <mutex>
#include <thread>
@@ -585,6 +586,8 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
g_Config.bSaveSettings = false;
break;
case '-':
if (!strncmp(argv[i], "--loglevel=", strlen("--loglevel=")) && strlen(argv[i]) > strlen("--loglevel="))
logLevel = static_cast<LogTypes::LOG_LEVELS>(std::atoi(argv[i] + strlen("--loglevel=")));
if (!strncmp(argv[i], "--log=", strlen("--log=")) && strlen(argv[i]) > strlen("--log="))
fileToLog = argv[i] + strlen("--log=");
if (!strncmp(argv[i], "--state=", strlen("--state=")) && strlen(argv[i]) > strlen("--state="))
@@ -665,6 +668,8 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
if (fileToLog)
LogManager::GetInstance()->ChangeFileLog(fileToLog);
LogManager::GetInstance()->SetAllLogLevels(logLevel);
PostLoadConfig();
#if PPSSPP_PLATFORM(ANDROID)