feat: granular startup logging

This commit is contained in:
goat 2021-02-10 16:38:44 +01:00
parent 5a48920032
commit 3d68ad2869

View file

@ -185,30 +185,48 @@ namespace Dalamud {
TargetModule = Process.GetCurrentProcess().MainModule; TargetModule = Process.GetCurrentProcess().MainModule;
SigScanner = new SigScanner(TargetModule, true); SigScanner = new SigScanner(TargetModule, true);
Log.Information("[START] Scanner OK!");
AntiDebug = new AntiDebug(SigScanner); AntiDebug = new AntiDebug(SigScanner);
#if DEBUG #if DEBUG
AntiDebug.Enable(); AntiDebug.Enable();
#endif #endif
Log.Information("[START] AntiDebug OK!");
// Initialize game subsystem // Initialize game subsystem
Framework = new Framework(SigScanner, this); Framework = new Framework(SigScanner, this);
Log.Information("[START] Framework OK!");
WinSock2 = new WinSockHandlers(); WinSock2 = new WinSockHandlers();
Log.Information("[START] WinSock OK!");
NetworkHandlers = new NetworkHandlers(this, StartInfo.OptOutMbCollection); NetworkHandlers = new NetworkHandlers(this, StartInfo.OptOutMbCollection);
Log.Information("[START] NH OK!");
ClientState = new ClientState(this, StartInfo, SigScanner); ClientState = new ClientState(this, StartInfo, SigScanner);
Log.Information("[START] CS OK!");
LocalizationManager = new Localization(AssetDirectory.FullName); LocalizationManager = new Localization(AssetDirectory.FullName);
if (!string.IsNullOrEmpty(Configuration.LanguageOverride)) if (!string.IsNullOrEmpty(Configuration.LanguageOverride))
LocalizationManager.SetupWithLangCode(Configuration.LanguageOverride); LocalizationManager.SetupWithLangCode(Configuration.LanguageOverride);
else else
LocalizationManager.SetupWithUiCulture(); LocalizationManager.SetupWithUiCulture();
Log.Information("[START] LOC OK!");
PluginRepository = new PluginRepository(this, StartInfo.PluginDirectory, StartInfo.GameVersion); PluginRepository = new PluginRepository(this, StartInfo.PluginDirectory, StartInfo.GameVersion);
Log.Information("[START] PREPO OK!");
DalamudUi = new DalamudInterface(this); DalamudUi = new DalamudInterface(this);
Log.Information("[START] DUI OK!");
var isInterfaceLoaded = false; var isInterfaceLoaded = false;
if (!bool.Parse(Environment.GetEnvironmentVariable("DALAMUD_NOT_HAVE_INTERFACE") ?? "false")) { if (!bool.Parse(Environment.GetEnvironmentVariable("DALAMUD_NOT_HAVE_INTERFACE") ?? "false")) {
try { try {
@ -218,6 +236,8 @@ namespace Dalamud {
InterfaceManager.Enable(); InterfaceManager.Enable();
isInterfaceLoaded = true; isInterfaceLoaded = true;
Log.Information("[START] IM OK!");
InterfaceManager.WaitForFontRebuild(); InterfaceManager.WaitForFontRebuild();
} catch (Exception e) { } catch (Exception e) {
Log.Information(e, "Could not init interface."); Log.Information(e, "Could not init interface.");
@ -233,29 +253,44 @@ namespace Dalamud {
return; return;
} }
Log.Information("[START] Data OK!");
SeStringManager = new SeStringManager(Data); SeStringManager = new SeStringManager(Data);
Log.Information("[START] SeString OK!");
// Initialize managers. Basically handlers for the logic // Initialize managers. Basically handlers for the logic
CommandManager = new CommandManager(this, StartInfo.Language); CommandManager = new CommandManager(this, StartInfo.Language);
DalamudCommands = new DalamudCommands(this); DalamudCommands = new DalamudCommands(this);
DalamudCommands.SetupCommands(); DalamudCommands.SetupCommands();
Log.Information("[START] CM OK!");
ChatHandlers = new ChatHandlers(this); ChatHandlers = new ChatHandlers(this);
Log.Information("[START] CH OK!");
if (!bool.Parse(Environment.GetEnvironmentVariable("DALAMUD_NOT_HAVE_PLUGINS") ?? "false")) { if (!bool.Parse(Environment.GetEnvironmentVariable("DALAMUD_NOT_HAVE_PLUGINS") ?? "false")) {
try { try {
PluginRepository.CleanupPlugins(); PluginRepository.CleanupPlugins();
Log.Information("[START] PRC OK!");
PluginManager = PluginManager =
new PluginManager(this, StartInfo.PluginDirectory, StartInfo.DefaultPluginDirectory); new PluginManager(this, StartInfo.PluginDirectory, StartInfo.DefaultPluginDirectory);
PluginManager.LoadPlugins(); PluginManager.LoadPlugins();
Log.Information("[START] PM OK!");
} catch (Exception ex) { } catch (Exception ex) {
Log.Error(ex, "Plugin load failed."); Log.Error(ex, "Plugin load failed.");
} }
} }
Framework.Enable(); Framework.Enable();
Log.Information("[START] Framework ENABLE!");
ClientState.Enable(); ClientState.Enable();
Log.Information("[START] CS ENABLE!");
IsReady = true; IsReady = true;