]> source.dussan.org Git - pf4j.git/commitdiff
add debug messages for PropertiesPluginDescriptorFinder
authorDecebal Suiu <decebal.suiu@gmail.com>
Thu, 26 Sep 2013 10:35:28 +0000 (13:35 +0300)
committerDecebal Suiu <decebal.suiu@gmail.com>
Thu, 26 Sep 2013 10:35:28 +0000 (13:35 +0300)
demo/app/src/main/resources/log4j.properties
pf4j/src/main/java/ro/fortsoft/pf4j/PropertiesPluginDescriptorFinder.java

index f7663881e0eedb9052fcd0f6f9f134ecca40fdcb..3ac64fdc365733e1b098ad0245a94c55f8c63f77 100644 (file)
@@ -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
 
index 4f0e753f2e18c9ebd6a604b8910345a17e43dc2a..2c7c70738c4cac0ae97c8e419c90edc2d4830c9b 100644 (file)
@@ -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");
         }