mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
feat: get boot log path from DalamudStartInfo
This commit is contained in:
parent
ce49874935
commit
5c3c22490d
3 changed files with 8 additions and 1 deletions
|
|
@ -79,6 +79,7 @@ void from_json(const nlohmann::json& json, DalamudStartInfo& config) {
|
||||||
config.GameVersion = json.value("GameVersion", config.GameVersion);
|
config.GameVersion = json.value("GameVersion", config.GameVersion);
|
||||||
config.DelayInitializeMs = json.value("DelayInitializeMs", config.DelayInitializeMs);
|
config.DelayInitializeMs = json.value("DelayInitializeMs", config.DelayInitializeMs);
|
||||||
|
|
||||||
|
config.BootLogPath = json.value("BootLogPath", config.BootLogPath);
|
||||||
config.BootShowConsole = json.value("BootShowConsole", config.BootShowConsole);
|
config.BootShowConsole = json.value("BootShowConsole", config.BootShowConsole);
|
||||||
config.BootDisableFallbackConsole = json.value("BootDisableFallbackConsole", config.BootDisableFallbackConsole);
|
config.BootDisableFallbackConsole = json.value("BootDisableFallbackConsole", config.BootDisableFallbackConsole);
|
||||||
config.BootWaitMessageBox = json.value("BootWaitMessageBox", config.BootWaitMessageBox);
|
config.BootWaitMessageBox = json.value("BootWaitMessageBox", config.BootWaitMessageBox);
|
||||||
|
|
@ -99,6 +100,7 @@ void from_json(const nlohmann::json& json, DalamudStartInfo& config) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DalamudStartInfo::from_envvars() {
|
void DalamudStartInfo::from_envvars() {
|
||||||
|
BootLogPath = utils::get_env<std::string>(L"DALAMUD_BOOT_LOGFILE");
|
||||||
BootShowConsole = utils::get_env<bool>(L"DALAMUD_SHOW_CONSOLE");
|
BootShowConsole = utils::get_env<bool>(L"DALAMUD_SHOW_CONSOLE");
|
||||||
BootDisableFallbackConsole = utils::get_env<bool>(L"DALAMUD_DISABLE_FALLBACK_CONSOLE");
|
BootDisableFallbackConsole = utils::get_env<bool>(L"DALAMUD_DISABLE_FALLBACK_CONSOLE");
|
||||||
BootWaitMessageBox = static_cast<WaitMessageboxFlags>(utils::get_env<int>(L"DALAMUD_WAIT_MESSAGEBOX"));
|
BootWaitMessageBox = static_cast<WaitMessageboxFlags>(utils::get_env<int>(L"DALAMUD_WAIT_MESSAGEBOX"));
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ struct DalamudStartInfo {
|
||||||
std::string GameVersion;
|
std::string GameVersion;
|
||||||
int DelayInitializeMs = 0;
|
int DelayInitializeMs = 0;
|
||||||
|
|
||||||
|
std::string BootLogPath;
|
||||||
bool BootShowConsole = false;
|
bool BootShowConsole = false;
|
||||||
bool BootDisableFallbackConsole = false;
|
bool BootDisableFallbackConsole = false;
|
||||||
WaitMessageboxFlags BootWaitMessageBox = WaitMessageboxFlags::None;
|
WaitMessageboxFlags BootWaitMessageBox = WaitMessageboxFlags::None;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
|
#include <codecvt>
|
||||||
|
|
||||||
#include "DalamudStartInfo.h"
|
#include "DalamudStartInfo.h"
|
||||||
#include "logging.h"
|
#include "logging.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
@ -26,8 +28,10 @@ DllExport DWORD WINAPI Initialize(LPVOID lpParam, HANDLE hMainThreadContinue) {
|
||||||
|
|
||||||
logging::update_dll_load_status(true);
|
logging::update_dll_load_status(true);
|
||||||
|
|
||||||
|
const auto logFilePath = unicode::convert<std::wstring>(g_startInfo.BootLogPath);
|
||||||
|
|
||||||
auto attemptFallbackLog = false;
|
auto attemptFallbackLog = false;
|
||||||
if (const auto logFilePath = utils::get_env<std::wstring>("DALAMUD_BOOT_LOGFILE"); logFilePath.empty()) {
|
if (logFilePath.empty()) {
|
||||||
attemptFallbackLog = true;
|
attemptFallbackLog = true;
|
||||||
|
|
||||||
logging::I("No log file path given; not logging to file.");
|
logging::I("No log file path given; not logging to file.");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue