summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDecebal Suiu <decebal.suiu@gmail.com>2013-09-26 13:35:28 +0300
committerDecebal Suiu <decebal.suiu@gmail.com>2013-09-26 13:35:28 +0300
commit6dd1c458b5306293bb133f5e3c9b88a9ee9106a7 (patch)
tree6c3962f7fc6338fcb81678cd9b17606abe99637f
parent5c15a04845079ee4669b008e32c2f6f605d5f63c (diff)
downloadpf4j-6dd1c458b5306293bb133f5e3c9b88a9ee9106a7.tar.gz
pf4j-6dd1c458b5306293bb133f5e3c9b88a9ee9106a7.zip
add debug messages for PropertiesPluginDescriptorFinder
-rw-r--r--demo/app/src/main/resources/log4j.properties2
-rw-r--r--pf4j/src/main/java/ro/fortsoft/pf4j/PropertiesPluginDescriptorFinder.java10
2 files changed, 10 insertions, 2 deletions
diff --git a/demo/app/src/main/resources/log4j.properties b/demo/app/src/main/resources/log4j.properties
index f766388..3ac64fd 100644
--- a/demo/app/src/main/resources/log4j.properties
+++ b/demo/app/src/main/resources/log4j.properties
@@ -2,5 +2,5 @@ log4j.rootLogger=DEBUG,Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
-log4j.appender.Console.layout.conversionPattern=%-5p - %-30.30c{1} - %m\n
+log4j.appender.Console.layout.conversionPattern=%-5p - %-32.32c{1} - %m\n
diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/PropertiesPluginDescriptorFinder.java b/pf4j/src/main/java/ro/fortsoft/pf4j/PropertiesPluginDescriptorFinder.java
index 4f0e753..2c7c707 100644
--- a/pf4j/src/main/java/ro/fortsoft/pf4j/PropertiesPluginDescriptorFinder.java
+++ b/pf4j/src/main/java/ro/fortsoft/pf4j/PropertiesPluginDescriptorFinder.java
@@ -19,6 +19,9 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import ro.fortsoft.pf4j.util.StringUtils;
/**
@@ -28,10 +31,14 @@ import ro.fortsoft.pf4j.util.StringUtils;
*/
public class PropertiesPluginDescriptorFinder implements PluginDescriptorFinder {
+ private static final Logger log = LoggerFactory.getLogger(PropertiesPluginDescriptorFinder.class);
+
+ private static final String DEFAULT_PROPERTIES_FILE_NAME = "plugin.properties";
+
private String propertiesFileName;
public PropertiesPluginDescriptorFinder() {
- this("plugin.properties");
+ this(DEFAULT_PROPERTIES_FILE_NAME);
}
public PropertiesPluginDescriptorFinder(String propertiesFileName) {
@@ -41,6 +48,7 @@ public class PropertiesPluginDescriptorFinder implements PluginDescriptorFinder
@Override
public PluginDescriptor find(File pluginRepository) throws PluginException {
File propertiesFile = new File(pluginRepository, propertiesFileName);
+ log.debug("Lookup plugin descriptor in '{}'", propertiesFile);
if (!propertiesFile.exists()) {
throw new PluginException("Cannot find '" + propertiesFile + "' file");
}