mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 16:31:28 +12:00
Pause emulation on any fatal log message.
This commit is contained in:
parent
07e1766a7c
commit
e40019354c
1 changed files with 17 additions and 0 deletions
|
@ -99,6 +99,20 @@ static semaphore<> s_qt_mutex{};
|
|||
std::abort();
|
||||
}
|
||||
|
||||
struct pause_on_fatal final : logs::listener
|
||||
{
|
||||
~pause_on_fatal() override = default;
|
||||
|
||||
void log(u64 /*stamp*/, const logs::message& msg, const std::string& /*prefix*/, const std::string& /*text*/) override
|
||||
{
|
||||
if (msg.sev <= logs::level::fatal)
|
||||
{
|
||||
// Pause emulation if fatal error encountered
|
||||
Emu.Pause();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const char* arg_headless = "headless";
|
||||
const char* arg_no_gui = "no-gui";
|
||||
const char* arg_high_dpi = "hidpi";
|
||||
|
@ -260,6 +274,9 @@ int main(int argc, char** argv)
|
|||
log_file = logs::make_file_listener(fs::get_cache_dir() + "RPCS3.log", stats.avail_free / 4);
|
||||
}
|
||||
|
||||
std::unique_ptr<logs::listener> log_pauser = std::make_unique<pause_on_fatal>();
|
||||
logs::listener::add(log_pauser.get());
|
||||
|
||||
{
|
||||
const std::string firmware_version = utils::get_firmware_version();
|
||||
const std::string firmware_string = firmware_version.empty() ? "" : (" | Firmware version: " + firmware_version);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue