You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by he...@apache.org on 2005/10/08 16:28:30 UTC
svn commit: r307296 -
/jakarta/velocity/core/trunk/examples/event_example/EventExample.java
Author: henning
Date: Sat Oct 8 07:28:28 2005
New Revision: 307296
URL: http://svn.apache.org/viewcvs?rev=307296&view=rev
Log:
No longer uses LogSystem but uses LogChute
Modified:
jakarta/velocity/core/trunk/examples/event_example/EventExample.java
Modified: jakarta/velocity/core/trunk/examples/event_example/EventExample.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/examples/event_example/EventExample.java?rev=307296&r1=307295&r2=307296&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/examples/event_example/EventExample.java (original)
+++ jakarta/velocity/core/trunk/examples/event_example/EventExample.java Sat Oct 8 07:28:28 2005
@@ -22,7 +22,7 @@
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.MethodInvocationException;
-import org.apache.velocity.runtime.log.LogSystem;
+import org.apache.velocity.runtime.log.LogChute;
import org.apache.velocity.runtime.RuntimeServices;
import org.apache.velocity.app.event.EventCartridge;
@@ -44,7 +44,7 @@
public class EventExample implements ReferenceInsertionEventHandler,
NullSetEventHandler, MethodExceptionEventHandler,
- LogSystem
+ LogChute
{
private boolean logOutput = false;
@@ -307,15 +307,36 @@
}
/**
- * 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)
{
if (logOutput)
{
- System.out.print("Velocity Log : level : " + level + " msg : " + 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)
+ {
+ if (logOutput)
+ {
+ 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 boolean isLevelEnabled(int level)
+ {
+ return true;
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org