jon 01/05/06 12:45:48
Modified: build/lib log.jar
src/java/org/apache/velocity/runtime/log
AvalonLogSystem.java
Log:
upgraded to latest log.jar provided by Peter D. who preempted the fact
that interfaces changed in Avalon by providing us with a patch that fixes
the problems.
i did a ./build.sh jar and that passed and i did a build.sh test and that
passed as well.
-jon
Revision Changes Path
1.4 +101 -87 jakarta-velocity/build/lib/log.jar
<<Binary file>>
1.5 +5 -21
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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AvalonLogSystem.java 2001/04/08 21:58:29 1.4
+++ AvalonLogSystem.java 2001/05/06 19:45:47 1.5
@@ -58,11 +58,10 @@
import java.net.URL;
-import org.apache.log.Category;
import org.apache.log.Formatter;
import org.apache.log.Priority;
import org.apache.log.Logger;
-import org.apache.log.LogKit;
+import org.apache.log.Hierarchy;
import org.apache.log.LogTarget;
import org.apache.log.output.FileOutputLogTarget;
@@ -75,7 +74,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: AvalonLogSystem.java,v 1.4 2001/04/08 21:58:29 geirm Exp $
+ * @version $Id: AvalonLogSystem.java,v 1.5 2001/05/06 19:45:47 jon Exp $
*/
public class AvalonLogSystem implements LogSystem
{
@@ -121,16 +120,6 @@
public void init(String logFile)
throws Exception
{
- String targetName = "velocity";
- String priority = "DEBUG";
-
- Category category = LogKit.createCategory(
- targetName, LogKit.getPriorityForName( priority ) );
-
- /*
- * Just create a FileOutputLogTarget, this is taken
- * from the SAR deployer in Avalon.
- */
FileOutputLogTarget target = new FileOutputLogTarget();
File logFileLocation = new File (logFile);
@@ -139,15 +128,10 @@
target.setFilename( logPath );
target.setFormatter(new VelocityFormatter());
target.setFormat("%{time} %{message}\\n%{throwable}" );
-
- LogTarget logTargets[] = null;
-
- if ( null != target )
- {
- logTargets = new LogTarget[] { target };
- }
- logger = LogKit.createLogger( category, logTargets );
+ logger = Hierarchy.getDefaultHierarchy().getLoggerFor( "velocity" );
+ logger.setPriority( Priority.DEBUG );
+ logger.setLogTargets( new LogTarget[] { target } );
}
/**