You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by ge...@apache.org on 2001/11/09 01:57:09 UTC
cvs commit: jakarta-velocity/src/java/org/apache/velocity/runtime/log AvalonLogSystem.java VelocityFormatter.java
geirm 01/11/08 16:57:09
Modified: src/java/org/apache/velocity/runtime/log
AvalonLogSystem.java VelocityFormatter.java
Log:
Update to the deprecations declared in logkit v1.0
Revision Changes Path
1.10 +10 -10 jakarta-velocity/src/java/org/apache/velocity/runtime/log/AvalonLogSystem.java
Index: AvalonLogSystem.java
===================================================================
RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/log/AvalonLogSystem.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- AvalonLogSystem.java 2001/08/20 11:44:49 1.9
+++ AvalonLogSystem.java 2001/11/09 00:57:09 1.10
@@ -62,7 +62,7 @@
import org.apache.log.Logger;
import org.apache.log.Hierarchy;
import org.apache.log.LogTarget;
-import org.apache.log.output.FileOutputLogTarget;
+import org.apache.log.output.io.FileTarget;
import org.apache.velocity.util.StringUtils;
@@ -74,7 +74,7 @@
*
* @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
* @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
- * @version $Id: AvalonLogSystem.java,v 1.9 2001/08/20 11:44:49 geirm Exp $
+ * @version $Id: AvalonLogSystem.java,v 1.10 2001/11/09 00:57:09 geirm Exp $
*/
public class AvalonLogSystem implements LogSystem
{
@@ -145,15 +145,15 @@
public void init(String logFile)
throws Exception
{
- FileOutputLogTarget target = new FileOutputLogTarget();
- File logFileLocation = new File (logFile);
-
- logPath = logFileLocation.getAbsolutePath();
- target.setFilename( logPath );
- target.setFormatter(new VelocityFormatter());
- target.setFormat("%{time} %{message}\\n%{throwable}" );
-
+ /*
+ * make our FileTarget. Note we are going to keep the
+ * default behavior of not appending...
+ */
+ FileTarget target = new FileTarget( new File( logFile),
+ false,
+ new VelocityFormatter("%{time} %{message}\\n%{throwable}" ) );
+
/*
* use the toString() of RuntimeServices to make a unique logger
*/
1.3 +5 -0 jakarta-velocity/src/java/org/apache/velocity/runtime/log/VelocityFormatter.java
Index: VelocityFormatter.java
===================================================================
RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/log/VelocityFormatter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- VelocityFormatter.java 2001/03/05 11:46:30 1.2
+++ VelocityFormatter.java 2001/11/09 00:57:09 1.3
@@ -59,6 +59,11 @@
public class VelocityFormatter extends PatternFormatter
{
+ public VelocityFormatter( String format )
+ {
+ super( format );
+ }
+
/**
* Utility method to format time.
*
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>