Skip to content

Commit

Permalink
Log firmware after Emu was initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed Apr 10, 2021
1 parent 8311501 commit 004b44c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 3 additions & 6 deletions rpcs3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

static std::unique_ptr<logs::listener> log_pauser = std::make_unique<fatal_error_listener>();
logs::listener::add(log_pauser.get());
static std::unique_ptr<logs::listener> fatal_listener = std::make_unique<fatal_error_listener>();
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
logs::stored_message ver;
ver.m.ch = nullptr;
ver.m.sev = logs::level::always;
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
logs::stored_message sys;
Expand Down
6 changes: 6 additions & 0 deletions rpcs3/main_application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "util/types.hpp"
#include "util/logs.hpp"
#include "util/sysinfo.hpp"

#include "Input/pad_thread.h"
#include "Emu/System.h"
Expand Down Expand Up @@ -38,6 +39,11 @@ void main_application::InitializeEmulator(const std::string& user, bool show_gui
Emu.SetHasGui(show_gui);
Emu.SetUsr(user);
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. */
Expand Down

0 comments on commit 004b44c

Please sign in to comment.