Author: henning
Date: Sat Oct  1 05:10:59 2005
New Revision: 292964

URL: http://svn.apache.org/viewcvs?rev=292964&view=rev
Log:
make sure that a non LogSystem/non LogChute object passed into the
LogManager is not just silently ignored but logged at warn level
(might even be error).


Modified:
    
jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/LogManager.java

Modified: 
jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/LogManager.java
URL: 
http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/LogManager.java?rev=292964&r1=292963&r2=292964&view=diff
==============================================================================
--- 
jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/LogManager.java
 (original)
+++ 
jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/LogManager.java
 Sat Oct  1 05:10:59 2005
@@ -64,6 +64,8 @@
      */
     public static LogChute createLogChute(RuntimeServices rsvc) throws 
Exception
     {
+        Log log = rsvc.getLog();
+
         /*
          *  if a logSystem was set as a configuation value, use that. 
          *  This is any class the user specifies.
@@ -79,7 +81,7 @@
                 return (LogChute)o;
             }
             // then check for a LogSystem
-            if (o instanceof LogSystem)
+            else if (o instanceof LogSystem)
             {
                 // wrap the LogSystem into a chute.
                 LogChute chute = new LogChuteSystem((LogSystem)o);
@@ -89,6 +91,10 @@
                           "LogSystem has been deprecated. Please use a 
LogChute implementation.");
                 return chute;
             }
+            else
+            {
+                log.warn(o.getClass().getName() + " object passed in as log 
implementation which is not supported.");
+            }
         }
   
         /* otherwise, see if a class was specified.  You can put multiple 
@@ -113,8 +119,6 @@
             classes.add( obj );
         }
 
-        Log log = rsvc.getLog();
-
         /*
          *  now run through the list, trying each.  It's ok to 
          *  fail with a class not found, as we do this to also
@@ -183,7 +187,7 @@
         LogChute newLogChute = createLogChute(rsvc);
         LogChute oldLogChute = log.getLogChute();
 
-        // If the old LogChute was a PrimordialLogChute,
+        // If the old LogChute was the pre-Init logger,
         // dump its messages into the new system first.
         if (oldLogChute instanceof HoldingLogChute)
         {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to