From 5e2cca2cc5971c6dc7312436ccc1375f6a4d134d Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Sun, 15 Aug 2021 03:16:19 +0200 Subject: [PATCH] fix: log some more info together with InvalidPluginException --- Dalamud/Plugin/Internal/LocalPlugin.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dalamud/Plugin/Internal/LocalPlugin.cs b/Dalamud/Plugin/Internal/LocalPlugin.cs index 3299feced..3a57b25be 100644 --- a/Dalamud/Plugin/Internal/LocalPlugin.cs +++ b/Dalamud/Plugin/Internal/LocalPlugin.cs @@ -17,7 +17,7 @@ namespace Dalamud.Plugin.Internal /// internal class LocalPlugin : IDisposable { - private static readonly ModuleLog Log = new("PLUGIN"); + private static readonly ModuleLog Log = new("LOCALPLUGIN"); private readonly Dalamud dalamud; private readonly FileInfo manifestFile; @@ -41,7 +41,7 @@ namespace Dalamud.Plugin.Internal this.DllFile = dllFile; this.State = PluginState.Unloaded; - this.loader ??= PluginLoader.CreateFromAssemblyFile( + this.loader = PluginLoader.CreateFromAssemblyFile( this.DllFile.FullName, config => { @@ -55,20 +55,20 @@ namespace Dalamud.Plugin.Internal try { // BadImageFormatException - this.pluginAssembly ??= this.loader.LoadDefaultAssembly(); + this.pluginAssembly = this.loader.LoadDefaultAssembly(); // InvalidOperationException this.pluginType = this.pluginAssembly.GetTypes().First(type => type.IsAssignableTo(typeof(IDalamudPlugin))); assemblyVersion = this.pluginAssembly.GetName().Version; } - catch (Exception) + catch (Exception ex) { this.pluginAssembly = null; this.pluginType = null; this.loader.Dispose(); - Log.Debug($"Not a plugin: {this.DllFile.Name}"); + Log.Error(ex, $"Not a plugin: {this.DllFile.Name}"); throw new InvalidPluginException(this.DllFile); }