From 8989ae94a73925b0feaffabd0046c854b1a1fb22 Mon Sep 17 00:00:00 2001 From: Brant Martin Date: Thu, 14 Jun 2018 11:08:09 -0400 Subject: [PATCH] Debug output for plugin loading --- Torch/Plugins/PluginManager.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Torch/Plugins/PluginManager.cs b/Torch/Plugins/PluginManager.cs index e34852c..b2531ea 100644 --- a/Torch/Plugins/PluginManager.cs +++ b/Torch/Plugins/PluginManager.cs @@ -377,6 +377,7 @@ namespace Torch.Managers private void InstantiatePlugin(PluginManifest manifest, IEnumerable assemblies) { Type pluginType = null; + bool mult = false; foreach (var asm in assemblies) { foreach (var type in asm.GetExportedTypes()) @@ -384,16 +385,26 @@ namespace Torch.Managers if (!type.GetInterfaces().Contains(typeof(ITorchPlugin))) continue; + _log.Info($"Loading plugin at {type.FullName}"); + if (pluginType != null) { - _log.Error($"The plugin '{manifest.Name}' has multiple implementations of {nameof(ITorchPlugin)}, not loading."); - return; + //_log.Error($"The plugin '{manifest.Name}' has multiple implementations of {nameof(ITorchPlugin)}, not loading."); + //return; + mult = true; + continue; } pluginType = type; } } + if (mult) + { + _log.Error($"The plugin '{manifest.Name}' has multiple implementations of {nameof(ITorchPlugin)}, not loading."); + return; + } + if (pluginType == null) { _log.Error($"The plugin '{manifest.Name}' does not have an implementation of {nameof(ITorchPlugin)}, not loading.");