mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Update logging to reflect msvc updates on std::format (#883)
This commit is contained in:
parent
c6cf47ea2d
commit
2f4c0bbc97
15 changed files with 238 additions and 183 deletions
|
|
@ -13,32 +13,32 @@ DllExport DWORD WINAPI Initialize(LPVOID lpParam, HANDLE hMainThreadContinue) {
|
|||
ConsoleSetup(L"Dalamud Boot");
|
||||
|
||||
if (const auto logFilePath = utils::get_env<std::wstring>("DALAMUD_BOOT_LOGFILE"); logFilePath.empty())
|
||||
logging::print<logging::I>("No log file path given; not logging to file.");
|
||||
logging::I("No log file path given; not logging to file.");
|
||||
else {
|
||||
try {
|
||||
logging::start_file_logging(logFilePath, !bootconfig::is_show_console());
|
||||
logging::print<logging::I>(L"Logging to file: {}", logFilePath);
|
||||
logging::I("Logging to file: {}", logFilePath);
|
||||
} catch (const std::exception& e) {
|
||||
logging::print<logging::E>(L"Couldn't open log file: {}", logFilePath);
|
||||
logging::print<logging::E>("Error: {} / {}", errno, e.what());
|
||||
logging::E("Couldn't open log file: {}", logFilePath);
|
||||
logging::E("Error: {} / {}", errno, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
logging::print<logging::I>("Dalamud.Boot Injectable, (c) 2021 XIVLauncher Contributors");
|
||||
logging::print<logging::I>("Built at: " __DATE__ "@" __TIME__);
|
||||
logging::I("Dalamud.Boot Injectable, (c) 2021 XIVLauncher Contributors");
|
||||
logging::I("Built at: " __DATE__ "@" __TIME__);
|
||||
|
||||
if (bootconfig::wait_messagebox() & bootconfig::WaitMessageboxFlags::BeforeInitialize)
|
||||
MessageBoxW(nullptr, L"Press OK to continue", L"Dalamud Boot", MB_OK);
|
||||
|
||||
logging::print<logging::I>("Applying fixes...");
|
||||
logging::I("Applying fixes...");
|
||||
xivfixes::apply_all(true);
|
||||
logging::print<logging::I>("Fixes OK");
|
||||
logging::I("Fixes OK");
|
||||
|
||||
if (bootconfig::is_wait_debugger()) {
|
||||
logging::print<logging::I>("Waiting for debugger to attach...");
|
||||
logging::I("Waiting for debugger to attach...");
|
||||
while (!IsDebuggerPresent())
|
||||
Sleep(100);
|
||||
logging::print<logging::I>("Debugger attached.");
|
||||
logging::I("Debugger attached.");
|
||||
}
|
||||
|
||||
const auto fs_module_path = utils::get_module_path(g_hModule);
|
||||
|
|
@ -47,7 +47,7 @@ DllExport DWORD WINAPI Initialize(LPVOID lpParam, HANDLE hMainThreadContinue) {
|
|||
|
||||
// ============================== CLR ========================================= //
|
||||
|
||||
logging::print<logging::I>("Calling InitializeClrAndGetEntryPoint");
|
||||
logging::I("Calling InitializeClrAndGetEntryPoint");
|
||||
|
||||
void* entrypoint_vfn;
|
||||
int result = InitializeClrAndGetEntryPoint(
|
||||
|
|
@ -67,16 +67,16 @@ DllExport DWORD WINAPI Initialize(LPVOID lpParam, HANDLE hMainThreadContinue) {
|
|||
|
||||
// ============================== VEH ======================================== //
|
||||
|
||||
logging::print<logging::I>("Initializing VEH...");
|
||||
logging::I("Initializing VEH...");
|
||||
if (utils::is_running_on_linux()) {
|
||||
logging::print<logging::I>("=> VEH was disabled, running on linux");
|
||||
logging::I("=> VEH was disabled, running on linux");
|
||||
} else if (bootconfig::is_veh_enabled()) {
|
||||
if (veh::add_handler(bootconfig::is_veh_full()))
|
||||
logging::print<logging::I>("=> Done!");
|
||||
logging::I("=> Done!");
|
||||
else
|
||||
logging::print<logging::I>("=> Failed!");
|
||||
logging::I("=> Failed!");
|
||||
} else {
|
||||
logging::print<logging::I>("VEH was disabled manually");
|
||||
logging::I("VEH was disabled manually");
|
||||
}
|
||||
|
||||
// ============================== Dalamud ==================================== //
|
||||
|
|
@ -91,9 +91,9 @@ DllExport DWORD WINAPI Initialize(LPVOID lpParam, HANDLE hMainThreadContinue) {
|
|||
|
||||
utils::wait_for_game_window();
|
||||
|
||||
logging::print<logging::I>("Initializing Dalamud...");
|
||||
logging::I("Initializing Dalamud...");
|
||||
entrypoint_fn(lpParam, hMainThreadContinue);
|
||||
logging::print<logging::I>("Done!");
|
||||
logging::I("Done!");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -105,7 +105,7 @@ BOOL APIENTRY DllMain(const HMODULE hModule, const DWORD dwReason, LPVOID lpRese
|
|||
case DLL_PROCESS_ATTACH:
|
||||
g_hModule = hModule;
|
||||
if (const auto mhStatus = MH_Initialize(); MH_OK != mhStatus) {
|
||||
logging::print<logging::E>("Failed to initialize MinHook (status={})", static_cast<int>(mhStatus));
|
||||
logging::E("Failed to initialize MinHook (status={})", static_cast<int>(mhStatus));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ BOOL APIENTRY DllMain(const HMODULE hModule, const DWORD dwReason, LPVOID lpRese
|
|||
xivfixes::apply_all(false);
|
||||
|
||||
if (const auto mhStatus = MH_Uninitialize(); MH_OK != mhStatus) {
|
||||
logging::print<logging::E>("Failed to uninitialize MinHook (status={})", static_cast<int>(mhStatus));
|
||||
logging::E("Failed to uninitialize MinHook (status={})", static_cast<int>(mhStatus));
|
||||
__fastfail(logging::MinHookUnload);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue