Skip to content

Commit

Permalink
Fix logging flags
Browse files Browse the repository at this point in the history
1. The logging flags were being ignored (-v, -d)
2. Adds a `--loglevel` argument. Useful when using the debug build for
   ASAN/UBSAN to hide extremely noisy debug messages.
  • Loading branch information
glebm committed Jan 30, 2021
1 parent 53b249f commit f372a21
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions UI/NativeApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include <locale.h>
#include <algorithm>
#include <cstdlib>
#include <memory>
#include <mutex>
#include <thread>
Expand Down Expand Up @@ -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="))
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f372a21

Please sign in to comment.