diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java b/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java index cdfeb38..ede596a 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/AbstractExtensionFinder.java @@ -186,13 +186,15 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin entries = null; } - protected void logExtensions(Set extensions) { - if (extensions.isEmpty()) { - log.debug("No extensions found"); - } else { - log.debug("Found possible {} extensions:", extensions.size()); - for (String extension : extensions) { - log.debug(" " + extension); + protected void debugExtensions(Set extensions) { + if (log.isDebugEnabled()) { + if (extensions.isEmpty()) { + log.debug("No extensions found"); + } else { + log.debug("Found possible {} extensions:", extensions.size()); + for (String extension : extensions) { + log.debug(" " + extension); + } } } } diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/LegacyExtensionFinder.java b/pf4j/src/main/java/ro/fortsoft/pf4j/LegacyExtensionFinder.java index dc47d0e..ff5379c 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/LegacyExtensionFinder.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/LegacyExtensionFinder.java @@ -59,7 +59,7 @@ public class LegacyExtensionFinder extends AbstractExtensionFinder { LegacyExtensionStorage.read(reader, bucket); } - logExtensions(bucket); + debugExtensions(bucket); result.put(null, bucket); } catch (IOException e) { @@ -90,7 +90,7 @@ public class LegacyExtensionFinder extends AbstractExtensionFinder { log.debug("Cannot find '{}'", getExtensionsResource()); } - logExtensions(bucket); + debugExtensions(bucket); result.put(pluginId, bucket); } catch (IOException e) { diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/ServiceProviderExtensionFinder.java b/pf4j/src/main/java/ro/fortsoft/pf4j/ServiceProviderExtensionFinder.java index 1794f69..fae6b08 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/ServiceProviderExtensionFinder.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/ServiceProviderExtensionFinder.java @@ -74,7 +74,7 @@ public class ServiceProviderExtensionFinder extends AbstractExtensionFinder { bucket.addAll(readExtensions(extensionPath)); } - logExtensions(bucket); + debugExtensions(bucket); result.put(null, bucket); } catch (IOException | URISyntaxException e) { @@ -111,7 +111,7 @@ public class ServiceProviderExtensionFinder extends AbstractExtensionFinder { log.debug("Cannot find '{}'", getExtensionsResource()); } - logExtensions(bucket); + debugExtensions(bucket); result.put(pluginId, bucket); } catch (IOException | URISyntaxException e) {