Author: wglass
Date: Sat Oct  1 18:34:20 2005
New Revision: 293053

URL: http://svn.apache.org/viewcvs?rev=293053&view=rev
Log:
change LoggerExample to use LogChute

Modified:
    jakarta/velocity/core/trunk/examples/logger_example/LoggerExample.java

Modified: jakarta/velocity/core/trunk/examples/logger_example/LoggerExample.java
URL: 
http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/examples/logger_example/LoggerExample.java?rev=293053&r1=293052&r2=293053&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/examples/logger_example/LoggerExample.java 
(original)
+++ jakarta/velocity/core/trunk/examples/logger_example/LoggerExample.java Sat 
Oct  1 18:34:20 2005
@@ -15,7 +15,7 @@
  */
 
 import org.apache.velocity.app.Velocity;
-import org.apache.velocity.runtime.log.LogSystem;
+import org.apache.velocity.runtime.log.LogChute;
 import org.apache.velocity.runtime.RuntimeServices;
 
 
@@ -30,7 +30,7 @@
  * @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
  * @version $Id$
  */
-public class LoggerExample implements LogSystem
+public class LoggerExample implements LogChute
 {
     public LoggerExample()
     {
@@ -66,12 +66,31 @@
         }
         
     /**
-     *  This is the key method needed to implement a logging interface
-     *  for Velocity.
+     * This just prints the message and level to System.out.
      */ 
-    public void logVelocityMessage(int level, String message)
+    public void log(int level, String message)
     {
         System.out.println("level : " + level + " msg : " + message);
+    }
+
+     
+    /**
+     * This prints the level, message, and the Throwable's message to 
+     * System.out.
+     */ 
+    public void log(int level, String message, Throwable t)
+    {
+        System.out.println("level : " + level + " msg : " + message + " t : "
+                           + t.getMessage());
+    }
+
+    /**
+     * This always returns true because logging levels can't be disabled in
+     * this impl.
+     */
+    public void isLevelEnabled(int level)
+    {
+        return true;
     }
 
     public static void main(String[] args)



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

Reply via email to