geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject cvs commit: incubator-geronimo/modules/twiddle/src/java/org/apache/geronimo/twiddle/cli Main.java
Date Wed, 27 Aug 2003 11:08:57 GMT
jdillon     2003/08/27 04:08:57

  Modified:    modules/twiddle/src/java/org/apache/geronimo/twiddle/cli
                        Main.java
  Added:       modules/twiddle/src/conf twiddle.properties
  Log:
   o Externalize the setting of the default log impl
  
  Revision  Changes    Path
  1.1                  incubator-geronimo/modules/twiddle/src/conf/twiddle.properties
  
  Index: twiddle.properties
  ===================================================================
  ##
  ## Twiddle Default Properties
  ##
  ## $Revision: 1.1 $ $Date: 2003/08/27 11:08:57 $
  ##
  
  # Use the caching log impl by default
  org.apache.commons.logging.Log=org.apache.geronimo.common.log.log4j.CachingLog4jLog
  
  
  
  1.12      +8 -21     incubator-geronimo/modules/twiddle/src/java/org/apache/geronimo/twiddle/cli/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/twiddle/src/java/org/apache/geronimo/twiddle/cli/Main.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Main.java	27 Aug 2003 10:38:38 -0000	1.11
  +++ Main.java	27 Aug 2003 11:08:57 -0000	1.12
  @@ -58,15 +58,12 @@
   
   import java.io.PrintWriter;
   import java.io.OutputStreamWriter;
  +import java.io.InputStream;
   
   import java.net.URL;
   
   import com.werken.classworlds.ClassWorld;
   
  -import org.apache.commons.logging.Log;
  -import org.apache.commons.logging.LogFactory;
  -import org.apache.commons.logging.impl.LogFactoryImpl;
  -
   import org.apache.commons.cli.Options;
   import org.apache.commons.cli.Option;
   import org.apache.commons.cli.CommandLine;
  @@ -89,17 +86,6 @@
    */
   public class Main
   {
  -    static {
  -        // Add our default Commons Logger that support the trace level
  -        if (System.getProperty(LogFactoryImpl.LOG_PROPERTY) == null) {
  -            System.setProperty(
  -                LogFactoryImpl.LOG_PROPERTY,
  -                "org.apache.geronimo.common.log.log4j.CachingLog4jLog");
  -        }
  -    }
  -    
  -    private static final Log log = LogFactory.getLog(Main.class);
  -    
       private String filename = "etc/twiddle.conf";
       private ClassWorld world;
       
  @@ -198,16 +184,17 @@
               throw new NullArgumentException("args");
           }
           
  +        // Read property defaults
  +        InputStream input = getClass().getResourceAsStream("/twiddle.properties");
  +        if (input != null) {
  +            System.getProperties().load(input);
  +        }
  +        
           // Process command-line options
           args = processCommandLine(args);
           
           URL homeURL = Twiddle.getHomeURL();
           URL configURL = new URL(homeURL, filename);
  -        
  -        if (log.isDebugEnabled()) {
  -            log.debug("Home URL: " + homeURL);
  -            log.debug("Configuration URL: " + configURL);
  -        }
           
           ConfigurationReader reader = new ConfigurationReader();
           Configuration config = reader.read(configURL);
  
  
  

Mime
View raw message