From efafda2650c6840b60e45497f3021cbfbca2d1d7 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 1 Feb 2020 07:14:26 +0300 Subject: [PATCH] Add config to silence all logs --- rpcs3/Emu/System.cpp | 6 ++++++ rpcs3/Emu/System.h | 1 + rpcs3/Json/tooltips.json | 1 + rpcs3/rpcs3qt/emu_settings.h | 2 ++ rpcs3/rpcs3qt/settings_dialog.cpp | 3 +++ rpcs3/rpcs3qt/settings_dialog.ui | 7 +++++++ 6 files changed, 20 insertions(+) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 556ccb3331..981e358a0b 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -1657,6 +1657,12 @@ void Emulator::Run() m_pause_amend_time = 0; m_state = system_state::running; + if (g_cfg.misc.silence_all_logs) + { + sys_log.notice("Now disabling logging..."); + logs::silence(); + } + auto on_select = [](u32, cpu_thread& cpu) { cpu.state -= cpu_flag::stop; diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index 4e58ceeaba..7f5f2e177f 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -624,6 +624,7 @@ struct cfg_root : cfg::node cfg::_bool show_shader_compilation_hint{ this, "Show shader compilation hint", true, true }; cfg::_bool use_native_interface{ this, "Use native user interface", true }; cfg::string gdb_server{this, "GDB Server", "127.0.0.1:2345"}; + cfg::_bool silence_all_logs{this, "Silence All Logs", false, false}; } misc{this}; diff --git a/rpcs3/Json/tooltips.json b/rpcs3/Json/tooltips.json index e29201d68d..aae710e02f 100644 --- a/rpcs3/Json/tooltips.json +++ b/rpcs3/Json/tooltips.json @@ -8,6 +8,7 @@ "liblv2": "This closely emulates how games can load and unload system module files on a real PlayStation 3.\nSome games require this.\nThis is the preferred option." }, "debugConsoleMode": "Increases the amount of usable system memory to match a DECR console and more.\nCauses some software to behave differently than on retail hardware.", + "silenceAllLogs": "Stop writing any logs after game startup. Don't use unless you believe it's necessary.", "readColor": "Initializes render target memory using vm memory.", "readDepth": "Initializes render target memory using vm memory.", "dumpDepth": "Writes depth buffer values to vm memory.", diff --git a/rpcs3/rpcs3qt/emu_settings.h b/rpcs3/rpcs3qt/emu_settings.h index 26d5f388e6..1edb90d680 100644 --- a/rpcs3/rpcs3qt/emu_settings.h +++ b/rpcs3/rpcs3qt/emu_settings.h @@ -46,6 +46,7 @@ public: SPUBlockSize, SPUCache, DebugConsoleMode, + SilenceAllLogs, MaxSPURSThreads, SleepTimersAccuracy, ClocksScale, @@ -368,6 +369,7 @@ private: { ShowWelcomeScreen, { "Miscellaneous", "Show Welcome Screen"}}, { UseNativeInterface, { "Miscellaneous", "Use native user interface"}}, { ShowShaderCompilationHint, { "Miscellaneous", "Show shader compilation hint"}}, + { SilenceAllLogs, { "Miscellaneous", "Silence All Logs" }}, // Networking { ConnectionStatus, { "Net", "Connection status"}}, diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index e8b29d301d..49e00a3049 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -920,6 +920,9 @@ settings_dialog::settings_dialog(std::shared_ptr guiSettings, std: xemu_settings->EnhanceCheckBox(ui->debugConsoleMode, emu_settings::DebugConsoleMode); SubscribeTooltip(ui->debugConsoleMode, json_advanced["debugConsoleMode"].toString()); + xemu_settings->EnhanceCheckBox(ui->silenceAllLogs, emu_settings::SilenceAllLogs); + SubscribeTooltip(ui->silenceAllLogs, json_advanced["silenceAllLogs"].toString()); + xemu_settings->EnhanceCheckBox(ui->readColor, emu_settings::ReadColorBuffers); SubscribeTooltip(ui->readColor, json_advanced["readColor"].toString()); diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index faa10ccd3e..6409fa3e9b 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -1582,6 +1582,13 @@ + + + + Silence All Logs + + +