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

@@ -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());

View File

@@ -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>