mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-08 20:58:41 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (!filter.CheckMessage(log_class, log_level)) {
|
||||
if (!filter.CheckMessage(log_class, log_level) || !Config::getLoggingEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -428,6 +428,7 @@ SettingsDialog::SettingsDialog(std::shared_ptr<gui_settings> gui_settings,
|
||||
ui->readbacksCheckBox->installEventFilter(this);
|
||||
ui->readbackLinearImagesCheckBox->installEventFilter(this);
|
||||
ui->separateLogFilesCheckbox->installEventFilter(this);
|
||||
ui->enableLoggingCheckBox->installEventFilter(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -547,6 +548,7 @@ void SettingsDialog::LoadValuesFromConfig() {
|
||||
ui->collectShaderCheckBox->setChecked(
|
||||
toml::find_or<bool>(data, "Debug", "CollectShader", false));
|
||||
ui->readbacksCheckBox->setChecked(toml::find_or<bool>(data, "GPU", "readbacks", false));
|
||||
ui->enableLoggingCheckBox->setChecked(toml::find_or<bool>(data, "Debug", "logEnabled", true));
|
||||
ui->readbackLinearImagesCheckBox->setChecked(
|
||||
toml::find_or<bool>(data, "GPU", "readbackLinearImages", false));
|
||||
ui->enableCompatibilityCheckBox->setChecked(
|
||||
@@ -774,7 +776,9 @@ void SettingsDialog::updateNoteTextEdit(const QString& elementName) {
|
||||
} else if (elementName == "readbackLinearImagesCheckBox") {
|
||||
text = tr("Enable Readback Linear Images:\\nEnables async downloading of GPU modified linear images.\\nMight fix issues in some games.");
|
||||
} else if (elementName == "separateLogFilesCheckbox") {
|
||||
text = tr("Separate Log Files:\\nWrites a separate logfile for each game.");}
|
||||
text = tr("Separate Log Files:\\nWrites a separate logfile for each game.");
|
||||
} else if (elementName == "enableLoggingCheckBox") {
|
||||
text = tr("Enable Logging:\\nEnables logging.\\nDo not change this if you do not know what you're doing!\\nWhen asking for help, make sure this setting is ENABLED."); }
|
||||
// clang-format on
|
||||
ui->descriptionText->setText(text.replace("\\n", "\n"));
|
||||
}
|
||||
@@ -816,6 +820,7 @@ void SettingsDialog::UpdateSettings() {
|
||||
Config::setSideTrophy("bottom");
|
||||
}
|
||||
m_gui_settings->SetValue(gui::gl_playBackgroundMusic, ui->playBGMCheckBox->isChecked());
|
||||
Config::setLoggingEnabled(ui->enableLoggingCheckBox->isChecked());
|
||||
Config::setAllowHDR(ui->enableHDRCheckBox->isChecked());
|
||||
Config::setLogType(logTypeMap.value(ui->logTypeComboBox->currentText()).toStdString());
|
||||
Config::setMicDevice(ui->micComboBox->currentData().toString().toStdString());
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>6</number>
|
||||
</property>
|
||||
<widget class="QScrollArea" name="generalTab">
|
||||
<property name="widgetResizable">
|
||||
@@ -73,8 +73,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>946</width>
|
||||
<height>536</height>
|
||||
<width>679</width>
|
||||
<height>420</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="generalTabVLayout" stretch="0">
|
||||
@@ -369,8 +369,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>68</height>
|
||||
<width>149</width>
|
||||
<height>69</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
@@ -538,8 +538,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>946</width>
|
||||
<height>536</height>
|
||||
<width>626</width>
|
||||
<height>370</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="guiTabVLayout" stretch="0">
|
||||
@@ -987,8 +987,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>946</width>
|
||||
<height>536</height>
|
||||
<width>553</width>
|
||||
<height>244</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="graphicsTabVLayout" stretch="0,0">
|
||||
@@ -1282,8 +1282,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>946</width>
|
||||
<height>536</height>
|
||||
<width>485</width>
|
||||
<height>348</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="userTabVLayout" stretch="0,0,1">
|
||||
@@ -1524,8 +1524,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>946</width>
|
||||
<height>536</height>
|
||||
<width>515</width>
|
||||
<height>228</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="inputTabVLayout" stretch="0,0">
|
||||
@@ -1796,8 +1796,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>946</width>
|
||||
<height>536</height>
|
||||
<width>421</width>
|
||||
<height>319</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="pathsTabLayout">
|
||||
@@ -1938,8 +1938,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>946</width>
|
||||
<height>536</height>
|
||||
<width>944</width>
|
||||
<height>537</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="debugTabVLayout" stretch="0,0">
|
||||
@@ -2013,6 +2013,20 @@
|
||||
<string>Logger</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="loggerLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="enableLoggingCheckBox">
|
||||
<property name="text">
|
||||
<string>Enable Logging</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="separateLogFilesCheckbox">
|
||||
<property name="text">
|
||||
<string>Separate Log Files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="LogTypeWidget" native="true">
|
||||
<layout class="QVBoxLayout" name="LogTypeLayout">
|
||||
@@ -2146,13 +2160,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="separateLogFilesCheckbox">
|
||||
<property name="text">
|
||||
<string>Separate Log Files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user