mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
feat: write Dalamud.Boot logs to dalamud.boot.log
This commit is contained in:
parent
ad4f2db203
commit
a7540d0fef
5 changed files with 39 additions and 14 deletions
|
|
@ -9,8 +9,17 @@ HMODULE g_hModule;
|
|||
HINSTANCE g_hGameInstance = GetModuleHandleW(nullptr);
|
||||
|
||||
DllExport DWORD WINAPI Initialize(LPVOID lpParam, HANDLE hMainThreadContinue) {
|
||||
logging::log_file.open(utils::get_env<std::wstring>("DALAMUD_BOOT_LOGFILE"), std::ios_base::out | std::ios_base::app);
|
||||
|
||||
if (bootconfig::is_show_console())
|
||||
ConsoleSetup(L"Dalamud Boot");
|
||||
|
||||
if (!logging::log_file) {
|
||||
logging::print<logging::E>("Couldn't open log file!");
|
||||
}
|
||||
|
||||
logging::print<logging::I>("Dalamud.Boot Injectable, (c) 2021 XIVLauncher Contributors");
|
||||
logging::print<logging::I>("Built at: " __DATE__ "@" __TIME__);
|
||||
|
||||
if (bootconfig::is_wait_messagebox())
|
||||
MessageBoxW(nullptr, L"Press OK to continue", L"Dalamud Boot", MB_OK);
|
||||
|
|
@ -22,9 +31,6 @@ DllExport DWORD WINAPI Initialize(LPVOID lpParam, HANDLE hMainThreadContinue) {
|
|||
logging::print<logging::W>("Error: {}", e.what());
|
||||
}
|
||||
|
||||
logging::print<logging::I>("Dalamud.Boot Injectable, (c) 2021 XIVLauncher Contributors");
|
||||
logging::print<logging::I>("Built at : " __DATE__ "@" __TIME__);
|
||||
|
||||
if (bootconfig::is_wait_debugger()) {
|
||||
logging::print<logging::I>("Waiting for debugger to attach...");
|
||||
while (!IsDebuggerPresent())
|
||||
|
|
@ -87,6 +93,7 @@ BOOL APIENTRY DllMain(const HMODULE hModule, const DWORD dwReason, LPVOID lpRese
|
|||
case DLL_PROCESS_DETACH:
|
||||
xivfixes::apply_all(false);
|
||||
veh::remove_handler();
|
||||
//logging::log_file.close();
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue