From b40e1638adbd54960e83f9624e1684ef94d288b7 Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Fri, 1 Jul 2016 23:21:16 +0300 Subject: [PATCH] Add useful log messages --- .../main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java | 6 +++++- .../main/java/ro/fortsoft/pf4j/LegacyExtensionFinder.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java b/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java index 5791cb3..900ebb9 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java @@ -62,6 +62,10 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin if (PluginState.STARTED != pluginWrapper.getPluginState()) { continue; } + + log.trace("Checking extensions from plugin '{}'", pluginId); + } else { + log.trace("Checking extensions from classpath"); } ClassLoader classLoader = (pluginId != null) ? pluginManager.getPluginClassLoader(pluginId) : getClass().getClassLoader(); @@ -73,7 +77,7 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin { // in this scenario the method 'isAssignableFrom' returns only FALSE // see http://www.coderanch.com/t/557846/java/java/FWIW-FYI-isAssignableFrom-isInstance-differing - log.error("Different class loaders: '{}' and '{}'", classLoader, typeClassLoader); + log.error("Different class loaders: '{}' (E) and '{}' (EP)", classLoader, typeClassLoader); // below line is commented because I wish to see the next log.trace line // continue; diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/LegacyExtensionFinder.java b/pf4j/src/main/java/ro/fortsoft/pf4j/LegacyExtensionFinder.java index 03a6bab..1e6e5db 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/LegacyExtensionFinder.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/LegacyExtensionFinder.java @@ -84,7 +84,7 @@ public class LegacyExtensionFinder extends AbstractExtensionFinder { List plugins = pluginManager.getPlugins(); for (PluginWrapper plugin : plugins) { String pluginId = plugin.getDescriptor().getPluginId(); - log.debug("Reading extensions storage for plugin '{}'", pluginId); + log.debug("Reading extensions storage from plugin '{}'", pluginId); Set bucket = new HashSet<>(); try { -- 2.39.5