01: package org.apache.dvsl;
02:
03: /*
04: * Licensed to the Apache Software Foundation (ASF) under one
05: * or more contributor license agreements. See the NOTICE file
06: * distributed with this work for additional information
07: * regarding copyright ownership. The ASF licenses this file
08: * to you under the Apache License, Version 2.0 (the
09: * "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: public AntLogSystem(Task task) {
38: super (task);
39: }
40:
41: /**
42: * <p>
43: * Log Velocity messages through the Ant Task log method. The mapping of logging
44: * levels from Velocity to Ant is as follows:
45: * </p>
46: *
47: * <blockquote><pre>
48: * Velocity Level --> Ant Level
49: * LogSystem.DEBUG_ID --> Project.MSG_DEBUG
50: * LogSystem.INFO_ID --> Project.MSG_VERBOSE
51: * LogSystem.WARN_ID --> Project.MSG_WARN
52: * LogSystem.ERROR_ID --> Project.MSG_ERR
53: * </pre></blockquote>
54: *
55: * @param level severity level
56: * @param message complete error message
57: * @see org.apache.velocity.runtime.log.LogSystem
58: * @see org.apache.tools.ant.Task#log(String, int)
59: * @deprecated use AntLogChute
60: */
61: public void logVelocityMessage(int level, String message) {
62: log(level, message);
63: }
64: }
|