mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 08:22:32 +00:00
Emulator: Create a Log Backup
This commit is contained in:
parent
b06790dfe5
commit
8ddc545592
@ -44,12 +44,21 @@ Frontend::WindowSDL* g_window = nullptr;
|
||||
namespace Core {
|
||||
|
||||
Emulator::Emulator() {
|
||||
// Initialize NT API functions and set high priority
|
||||
// Initialize NT API functions and set high priority.
|
||||
#ifdef _WIN32
|
||||
Common::NtApi::Initialize();
|
||||
SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS);
|
||||
#endif
|
||||
|
||||
// Renaming shad_log.txt to shad_log.old.txt when booting.
|
||||
const auto LogDir = Common::FS::GetUserPath(Common::FS::PathType::LogDir);
|
||||
const auto CurrentLog = LogDir / "shad_log.txt";
|
||||
const auto NewLogName = LogDir / "shad_log.old.txt";
|
||||
// Avoid crash due to shad_log.txt not existing.
|
||||
if (std::filesystem::exists(CurrentLog)) {
|
||||
rename(CurrentLog, NewLogName);
|
||||
}
|
||||
|
||||
// Start logger.
|
||||
Common::Log::Initialize();
|
||||
Common::Log::Start();
|
||||
|
Loading…
Reference in New Issue
Block a user