View Javadoc

1   package org.apache.dvsl;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.tools.ant.Task;
23  
24  import org.apache.velocity.runtime.log.LogSystem;
25  
26  /**
27   * Implementation of a logger to output messages via an Ant Task's log
28   * method.  Velocity log levels are mapped to corresponding log levels
29   * defined in Ant's logging API.  The end result is messages will only
30   * be output if Ant log level is high enough.
31   *
32   * @author    <a href="mailto:billb@progress.com">Bill Burton</a>
33   * @version   $Id: AntLogSystem.java 538000 2007-05-14 21:59:05Z cbrisson $
34   * @deprecated Use AntLogChute instead.
35   */
36  public class AntLogSystem extends AntLogChute implements LogSystem
37  {
38      public AntLogSystem(Task task) {
39          super(task);
40      }
41  
42      /**
43       * <p>
44       * Log Velocity messages through the Ant Task log method.  The mapping of logging
45       * levels from Velocity to Ant is as follows:
46       * </p>
47       *
48       * <blockquote><pre>
49       * Velocity Level      --&gt;  Ant Level
50       * LogSystem.DEBUG_ID  --&gt;  Project.MSG_DEBUG
51       * LogSystem.INFO_ID   --&gt;  Project.MSG_VERBOSE
52       * LogSystem.WARN_ID   --&gt;  Project.MSG_WARN
53       * LogSystem.ERROR_ID  --&gt;  Project.MSG_ERR
54       * </pre></blockquote>
55       *
56       * @param level    severity level
57       * @param message  complete error message
58       * @see   org.apache.velocity.runtime.log.LogSystem
59       * @see   org.apache.tools.ant.Task#log(String, int)
60       * @deprecated use AntLogChute
61       */
62      public void logVelocityMessage( int level, String message )
63      {
64          log(level,message);
65      }
66  }