Debug output for plugin loading
This commit is contained in:
@@ -377,6 +377,7 @@ namespace Torch.Managers
|
|||||||
private void InstantiatePlugin(PluginManifest manifest, IEnumerable<Assembly> assemblies)
|
private void InstantiatePlugin(PluginManifest manifest, IEnumerable<Assembly> assemblies)
|
||||||
{
|
{
|
||||||
Type pluginType = null;
|
Type pluginType = null;
|
||||||
|
bool mult = false;
|
||||||
foreach (var asm in assemblies)
|
foreach (var asm in assemblies)
|
||||||
{
|
{
|
||||||
foreach (var type in asm.GetExportedTypes())
|
foreach (var type in asm.GetExportedTypes())
|
||||||
@@ -384,16 +385,26 @@ namespace Torch.Managers
|
|||||||
if (!type.GetInterfaces().Contains(typeof(ITorchPlugin)))
|
if (!type.GetInterfaces().Contains(typeof(ITorchPlugin)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
_log.Info($"Loading plugin at {type.FullName}");
|
||||||
|
|
||||||
if (pluginType != null)
|
if (pluginType != null)
|
||||||
{
|
{
|
||||||
_log.Error($"The plugin '{manifest.Name}' has multiple implementations of {nameof(ITorchPlugin)}, not loading.");
|
//_log.Error($"The plugin '{manifest.Name}' has multiple implementations of {nameof(ITorchPlugin)}, not loading.");
|
||||||
return;
|
//return;
|
||||||
|
mult = true;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pluginType = type;
|
pluginType = type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mult)
|
||||||
|
{
|
||||||
|
_log.Error($"The plugin '{manifest.Name}' has multiple implementations of {nameof(ITorchPlugin)}, not loading.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (pluginType == null)
|
if (pluginType == null)
|
||||||
{
|
{
|
||||||
_log.Error($"The plugin '{manifest.Name}' does not have an implementation of {nameof(ITorchPlugin)}, not loading.");
|
_log.Error($"The plugin '{manifest.Name}' does not have an implementation of {nameof(ITorchPlugin)}, not loading.");
|
||||||
|
Reference in New Issue
Block a user