Update logging to reflect msvc updates on std::format (#883)

This commit is contained in:
kizer 2022-06-17 17:28:10 +09:00 committed by GitHub
parent c6cf47ea2d
commit 2f4c0bbc97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 238 additions and 183 deletions

View file

@ -269,16 +269,18 @@ LONG exception_handler(EXCEPTION_POINTERS* ex)
L"Dalamud.EntryPoint+VehDelegate, Dalamud",
nullptr, nullptr, &fn)))
{
const auto msg = L"An error within the game has occurred.\n\n"
const auto formatted = std::format(
L"An error within the game has occurred.\n\n"
L"This may be caused by a faulty plugin, a broken TexTools modification, any other third-party tool or simply a bug in the game.\n"
L"Please try \"Start Over\" or \"Download Index Backup\" in TexTools, an integrity check in the XIVLauncher settings, and disabling plugins you don't need.\n\n"
L"The log file is located at:\n"
L"{1}\n\n"
L"Press OK to exit the application.\n\nFailed to read stack trace: {2:08x}";
L"Press OK to exit the application.\n\nFailed to read stack trace: {2:08x}",
dmp_path, log_path, err);
// show in another thread to prevent messagebox from pumping messages of current thread
std::thread([&]() {
MessageBoxW(nullptr, std::format(msg, dmp_path, log_path, err).c_str(), L"Dalamud Error", MB_OK | MB_ICONERROR | MB_TOPMOST);
MessageBoxW(nullptr, formatted.c_str(), L"Dalamud Error", MB_OK | MB_ICONERROR | MB_TOPMOST);
}).join();
}
else