Toggle to enable/disable logging (#3493)

* Update config.cpp

* Update config.h

* Update backend.cpp

* Update settings_dialog.cpp

* Update settings_dialog.ui

* fix clang settings_dialog.cpp

* fix description in settings_dialog.cpp

* added back the backslash settings_dialog.cpp

* move enable logging and separate log files to logger settings_dialog.ui
This commit is contained in:
UltraDaCat
2025-08-31 22:11:49 +02:00
committed by GitHub
parent e6f0ee7ed2
commit ba65408608
5 changed files with 56 additions and 26 deletions

View File

@@ -96,6 +96,7 @@ static bool isDebugDump = false;
static bool isShaderDebug = false;
static bool isSeparateLogFilesEnabled = false;
static bool isFpsColor = true;
static bool logEnabled = true;
// GUI
static bool load_game_size = true;
@@ -140,6 +141,10 @@ int* GetControllerCustomColor() {
return controllerCustomColorRGB;
}
bool getLoggingEnabled() {
return logEnabled;
}
void SetControllerCustomColor(int r, int b, int g) {
controllerCustomColorRGB[0] = r;
controllerCustomColorRGB[1] = b;
@@ -313,6 +318,10 @@ bool fpsColor() {
return isFpsColor;
}
bool isLoggingEnabled() {
return logEnabled;
}
u32 vblankDiv() {
return vblankDivider;
}
@@ -389,6 +398,10 @@ void setDebugDump(bool enable) {
isDebugDump = enable;
}
void setLoggingEnabled(bool enable) {
logEnabled = enable;
}
void setCollectShaderForDebug(bool enable) {
isShaderDebug = enable;
}
@@ -738,6 +751,7 @@ void load(const std::filesystem::path& path) {
toml::find_or<bool>(debug, "isSeparateLogFilesEnabled", isSeparateLogFilesEnabled);
isShaderDebug = toml::find_or<bool>(debug, "CollectShader", isShaderDebug);
isFpsColor = toml::find_or<bool>(debug, "FPSColor", isFpsColor);
logEnabled = toml::find_or<bool>(debug, "logEnabled", logEnabled);
current_version = toml::find_or<std::string>(debug, "ConfigVersion", current_version);
}
@@ -893,6 +907,7 @@ void save(const std::filesystem::path& path) {
data["Debug"]["CollectShader"] = isShaderDebug;
data["Debug"]["isSeparateLogFilesEnabled"] = isSeparateLogFilesEnabled;
data["Debug"]["FPSColor"] = isFpsColor;
data["Debug"]["logEnabled"] = logEnabled;
data["Debug"]["ConfigVersion"] = config_version;
data["Keys"]["TrophyKey"] = trophyKey;
@@ -1005,6 +1020,7 @@ void setDefaultValues() {
isShaderDebug = false;
isSeparateLogFilesEnabled = false;
isFpsColor = true;
logEnabled = true;
// GUI
load_game_size = true;

View File

@@ -111,6 +111,8 @@ std::string getDefaultControllerID();
void setDefaultControllerID(std::string id);
bool getBackgroundControllerInput();
void setBackgroundControllerInput(bool enable);
bool getLoggingEnabled();
void setLoggingEnabled(bool enable);
// TODO
bool GetLoadGameSizeEnabled();

View File

@@ -191,7 +191,7 @@ public:
}
}
if (!filter.CheckMessage(log_class, log_level)) {
if (!filter.CheckMessage(log_class, log_level) || !Config::getLoggingEnabled()) {
return;
}