Log firmware after Emu was initialized

This commit is contained in:
Megamouse 2021-04-10 11:54:52 +02:00
parent 5b0dac797c
commit 332eb5fbd6
2 changed files with 9 additions and 6 deletions

View File

@ -440,19 +440,16 @@ int main(int argc, char** argv)
log_file = logs::make_file_listener(fs::get_cache_dir() + "RPCS3.log", stats.avail_free / 4); log_file = logs::make_file_listener(fs::get_cache_dir() + "RPCS3.log", stats.avail_free / 4);
} }
static std::unique_ptr<logs::listener> log_pauser = std::make_unique<fatal_error_listener>(); static std::unique_ptr<logs::listener> fatal_listener = std::make_unique<fatal_error_listener>();
logs::listener::add(log_pauser.get()); logs::listener::add(fatal_listener.get());
{ {
const std::string firmware_version = utils::get_firmware_version();
const std::string firmware_string = firmware_version.empty() ? " | Missing Firmware" : (" | Firmware version: " + firmware_version);
// Write RPCS3 version // Write RPCS3 version
logs::stored_message ver; logs::stored_message ver;
ver.m.ch = nullptr; ver.m.ch = nullptr;
ver.m.sev = logs::level::always; ver.m.sev = logs::level::always;
ver.stamp = 0; ver.stamp = 0;
ver.text = fmt::format("RPCS3 v%s | %s%s", rpcs3::get_version().to_string(), rpcs3::get_branch(), firmware_string); ver.text = fmt::format("RPCS3 v%s | %s", rpcs3::get_version().to_string(), rpcs3::get_branch());
// Write System information // Write System information
logs::stored_message sys; logs::stored_message sys;

View File

@ -2,6 +2,7 @@
#include "util/types.hpp" #include "util/types.hpp"
#include "util/logs.hpp" #include "util/logs.hpp"
#include "util/sysinfo.hpp"
#include "Input/pad_thread.h" #include "Input/pad_thread.h"
#include "Emu/System.h" #include "Emu/System.h"
@ -38,6 +39,11 @@ void main_application::InitializeEmulator(const std::string& user, bool show_gui
Emu.SetHasGui(show_gui); Emu.SetHasGui(show_gui);
Emu.SetUsr(user); Emu.SetUsr(user);
Emu.Init(); Emu.Init();
// Log Firmware Version after Emu was initialized
const std::string firmware_version = utils::get_firmware_version();
const std::string firmware_string = firmware_version.empty() ? "Missing Firmware" : ("Firmware version: " + firmware_version);
sys_log.always("%s", firmware_string);
} }
/** RPCS3 emulator has functions it desires to call from the GUI at times. Initialize them in here. */ /** RPCS3 emulator has functions it desires to call from the GUI at times. Initialize them in here. */