1
2
3
4 package org.ieee.shinobu.demo.velocity;
5
6 import org.apache.velocity.app.Velocity;
7 import org.apache.velocity.app.VelocityEngine;
8 import org.apache.velocity.runtime.RuntimeConstants;
9
10 /***
11 * @author shinobu
12 */
13 public class VelocityTestTool {
14
15 public static VelocityEngine newEngine() {
16 VelocityEngine engine = new VelocityEngine();
17
18 engine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.tools.generic.log.CommonsLogLogSystem");
19 engine.setProperty("runtime.log.logsystem.commons.logging.name", "test.velocity.log");
20
21 return engine;
22 }
23
24 public static void initSingletonLogger() {
25 Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.tools.generic.log.CommonsLogLogSystem");
26 Velocity.setProperty("runtime.log.logsystem.commons.logging.name", "test.velocity.log");
27 }
28
29 }