From 3d68ad2869fedd20f1f2ad23173085f619481237 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Wed, 10 Feb 2021 16:38:44 +0100 Subject: [PATCH] feat: granular startup logging --- Dalamud/Dalamud.cs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Dalamud/Dalamud.cs b/Dalamud/Dalamud.cs index 53781dafc..da5add064 100644 --- a/Dalamud/Dalamud.cs +++ b/Dalamud/Dalamud.cs @@ -185,30 +185,48 @@ namespace Dalamud { TargetModule = Process.GetCurrentProcess().MainModule; SigScanner = new SigScanner(TargetModule, true); + Log.Information("[START] Scanner OK!"); + AntiDebug = new AntiDebug(SigScanner); #if DEBUG AntiDebug.Enable(); #endif + Log.Information("[START] AntiDebug OK!"); + // Initialize game subsystem Framework = new Framework(SigScanner, this); + Log.Information("[START] Framework OK!"); + WinSock2 = new WinSockHandlers(); + Log.Information("[START] WinSock OK!"); + NetworkHandlers = new NetworkHandlers(this, StartInfo.OptOutMbCollection); + Log.Information("[START] NH OK!"); + ClientState = new ClientState(this, StartInfo, SigScanner); + Log.Information("[START] CS OK!"); + LocalizationManager = new Localization(AssetDirectory.FullName); if (!string.IsNullOrEmpty(Configuration.LanguageOverride)) LocalizationManager.SetupWithLangCode(Configuration.LanguageOverride); else LocalizationManager.SetupWithUiCulture(); + Log.Information("[START] LOC OK!"); + PluginRepository = new PluginRepository(this, StartInfo.PluginDirectory, StartInfo.GameVersion); + Log.Information("[START] PREPO OK!"); + DalamudUi = new DalamudInterface(this); + Log.Information("[START] DUI OK!"); + var isInterfaceLoaded = false; if (!bool.Parse(Environment.GetEnvironmentVariable("DALAMUD_NOT_HAVE_INTERFACE") ?? "false")) { try { @@ -218,6 +236,8 @@ namespace Dalamud { InterfaceManager.Enable(); isInterfaceLoaded = true; + Log.Information("[START] IM OK!"); + InterfaceManager.WaitForFontRebuild(); } catch (Exception e) { Log.Information(e, "Could not init interface."); @@ -233,29 +253,44 @@ namespace Dalamud { return; } + Log.Information("[START] Data OK!"); + SeStringManager = new SeStringManager(Data); + Log.Information("[START] SeString OK!"); + // Initialize managers. Basically handlers for the logic CommandManager = new CommandManager(this, StartInfo.Language); DalamudCommands = new DalamudCommands(this); DalamudCommands.SetupCommands(); + Log.Information("[START] CM OK!"); + ChatHandlers = new ChatHandlers(this); + Log.Information("[START] CH OK!"); + if (!bool.Parse(Environment.GetEnvironmentVariable("DALAMUD_NOT_HAVE_PLUGINS") ?? "false")) { try { PluginRepository.CleanupPlugins(); + Log.Information("[START] PRC OK!"); + PluginManager = new PluginManager(this, StartInfo.PluginDirectory, StartInfo.DefaultPluginDirectory); PluginManager.LoadPlugins(); + + Log.Information("[START] PM OK!"); } catch (Exception ex) { Log.Error(ex, "Plugin load failed."); } } Framework.Enable(); + Log.Information("[START] Framework ENABLE!"); + ClientState.Enable(); + Log.Information("[START] CS ENABLE!"); IsReady = true;