jvanzyl     01/01/01 18:42:29

  Modified:    src/java/org/apache/velocity/runtime Runtime.java
  Log:
  - runtime now uses the new log manager. will eventually move all
    logging functionality to the log manager but i wanted vel to
    build with the standard avalon jars.
  
  Revision  Changes    Path
  1.80      +10 -24    
jakarta-velocity/src/java/org/apache/velocity/runtime/Runtime.java
  
  Index: Runtime.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/Runtime.java,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- Runtime.java      2000/12/20 05:25:18     1.79
  +++ Runtime.java      2001/01/02 02:42:29     1.80
  @@ -71,16 +71,12 @@
   import java.util.TreeMap;
   import java.util.Vector;
   
  -import org.apache.log.LogKit;
   import org.apache.log.Logger;
  -import org.apache.log.LogTarget;
  -import org.apache.log.Formater;
  -import org.apache.log.output.FileOutputLogTarget;
   
  -import org.apache.velocity.runtime.log.VelocityFormater;
  -
   import org.apache.velocity.Template;
   
  +import org.apache.velocity.runtime.log.LogManager;
  +
   import org.apache.velocity.runtime.parser.Parser;
   import org.apache.velocity.runtime.parser.ParseException;
   import org.apache.velocity.runtime.parser.node.SimpleNode;
  @@ -173,7 +169,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Jeff Bowden</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Geir Magusson Jr.</a>
  - * @version $Id: Runtime.java,v 1.79 2000/12/20 05:25:18 jvanzyl Exp $
  + * @version $Id: Runtime.java,v 1.80 2001/01/02 02:42:29 jvanzyl Exp $
    */
   public class Runtime implements RuntimeConstants
   {    
  @@ -414,29 +410,19 @@
       /**
        * Initialize the Velocity logging system.
        */
  -    private static void initializeLogger() throws
  -        MalformedURLException
  +    private static void initializeLogger() throws Exception
       {
  -        /* 
  -         * Let's look at the log file entry and
  -         * correct it if it is not a property 
  -         * fomratted URL.
  +        /*
  +         * Grab the log file entry from the velocity
  +         * properties file.
            */
           String logFile = VelocityResources.getString(RUNTIME_LOG);
   
           /*
  -         * Initialize the logger.
  +         * Initialize the logger. We will eventually move all
  +         * logging into the logging manager.
            */
  -        logger = LogKit.createLogger("velocity", 
  -        StringUtils.fileToURL(logFile), "DEBUG");
  -                
  -        LogTarget[] t = logger.getLogTargets();            
  -
  -        ((FileOutputLogTarget)t[0])
  -            .setFormater((Formater) new VelocityFormater());
  -
  -        ((FileOutputLogTarget)t[0])
  -            .setFormat("%{time} %{message}\\n%{throwable}" );
  +        logger = LogManager.createLogger(logFile);
   
           if ( !pendingMessages.isEmpty())
           {
  
  
  

Reply via email to