LogManager: Hook up save/load, remove "long names"

This commit is contained in:
Henrik Rydgård committed 2017-03-06 11:44:35 +01:00
1 parent 50b722152a
commit cfe2621604
6 files changed
+62 -46

No files matched your search

+20 -2
View File
@@ -34,6 +34,7 @@
#include "Common/KeyMap.h"
#include "Common/FileUtil.h"
#include "Common/StringUtils.h"
#include "Common/LogManager.h"
#include "Core/Config.h"
#include "Core/Loaders.h"
#include "GPU/Common/FramebufferCommon.h"
@@ -46,6 +47,13 @@ Config g_Config;
bool jitForcedOff;
#ifdef _DEBUG
static const char *logSectionName = "LogDebug";
#else
static const char *logSectionName = "Log";
#endif
#ifdef IOS
extern bool iosCanUseJit;
#endif
@@ -844,6 +852,14 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
if (!File::Exists(currentDirectory))
currentDirectory = "";
IniFile::Section *log = iniFile.GetOrCreateSection(logSectionName);
bool debugDefaults = false;
#ifdef _DEBUG
debugDefaults = true;
#endif
LogManager::GetInstance()->LoadConfig(log, debugDefaults);
IniFile::Section *recent = iniFile.GetOrCreateSection("Recent");
recent->Get("MaxRecent", &iMaxRecent, 30);
@@ -950,8 +966,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
//so this is all the way down here to overwrite the controller settings
//sadly it won't benefit from all the "version conversion" going on up-above
//but these configs shouldn't contain older versions anyhow
if (bGameSpecific)
{
if (bGameSpecific) {
loadGameConfig(gameId_);
}
@@ -1020,6 +1035,9 @@ void Config::Save() {
IniFile::Section *control = iniFile.GetOrCreateSection("Control");
control->Delete("DPadRadius");
IniFile::Section *log = iniFile.GetOrCreateSection(logSectionName);
LogManager::GetInstance()->SaveConfig(log);
if (!iniFile.Save(iniFilename_.c_str())) {
ERROR_LOG(LOADER, "Error saving config - can't write ini %s", iniFilename_.c_str());
return;