Only initialize logging once

This commit is contained in:
Stephen Miller 2026-06-01 20:44:06 -05:00
parent 6d2e6a439a
commit 4fbd9608f2
2 changed files with 3 additions and 9 deletions

View File

@ -271,10 +271,9 @@ void Emulator::Run(std::filesystem::path file, std::vector<std::string> args,
}
game_info.game_folder = game_folder;
EmulatorSettings.Load(id);
Common::Log::Shutdown();
// Initialize logging as soon as possible
EmulatorSettings.Load(id);
Common::Log::Setup((!id.empty() && EmulatorSettings.IsLogSeparate()) ? id + ".log"
: "shad_log.txt");

View File

@ -103,9 +103,6 @@ int main(int argc, char* argv[]) {
if (waitPid)
Core::Debugger::WaitForPid(*waitPid);
// Start default log
Common::Log::Setup("shad_log.txt");
IPC::Instance().Init();
auto emu_state = std::make_shared<EmulatorState>();
@ -121,10 +118,8 @@ int main(int argc, char* argv[]) {
EmulatorSettingsImpl::SetInstance(emu_settings);
emu_settings->Load();
Common::Log::Shutdown();
// Start configured log
// Configure logger appropriately
Common::Log::g_should_append |= EmulatorSettings.IsLogAppend();
Common::Log::Setup("shad_log.txt");
if (bigPicture) {
BigPictureMode::Launch(argv[0]);