OSDN Git Service

CVS最新版の全ファイルを追加
[spring-ext/ozacc-mail.git] / src / java / com / ozacc / mail / impl / VelocityLogSystem.java
1 package com.ozacc.mail.impl;\r
2 \r
3 import org.apache.commons.logging.Log;\r
4 import org.apache.commons.logging.LogFactory;\r
5 import org.apache.velocity.app.Velocity;\r
6 import org.apache.velocity.runtime.RuntimeServices;\r
7 import org.apache.velocity.runtime.log.LogSystem;\r
8 \r
9 /**\r
10  * VelocityのログメッセージをCommonsLoggingを通して出力させるクラス。\r
11  * \r
12  * \r
13  * @see XMLVelocityMailBuilderImpl\r
14  * @see JDomXMLMailBuilder\r
15  * \r
16  * @since 1.0.3\r
17  * \r
18  * @author Tomohiro Otsuka\r
19  * @version $Id: VelocityLogSystem.java,v 1.2.2.1 2004/11/25 08:01:07 otsuka Exp $\r
20  */\r
21 public class VelocityLogSystem implements LogSystem {\r
22 \r
23         private static Log log = LogFactory.getLog(Velocity.class);\r
24 \r
25         /**\r
26          * @see org.apache.velocity.runtime.log.LogSystem#init(org.apache.velocity.runtime.RuntimeServices)\r
27          */\r
28         public void init(RuntimeServices rsvc) throws Exception {\r
29         // do nothing\r
30         }\r
31 \r
32         /**\r
33          * @see org.apache.velocity.runtime.log.LogSystem#logVelocityMessage(int, java.lang.String)\r
34          */\r
35         public void logVelocityMessage(int level, String message) {\r
36                 switch (level) {\r
37                         case DEBUG_ID:\r
38                                 log.debug(message);\r
39                                 break;\r
40                         case INFO_ID:\r
41                                 log.info(message);\r
42                                 break;\r
43                         case WARN_ID:\r
44                                 log.warn(message);\r
45                                 break;\r
46                         case ERROR_ID:\r
47                                 log.error(message);\r
48                                 break;\r
49                 }\r
50         }\r
51 \r
52 }