Package org.apache.dvsl
Class AntLogChute
- java.lang.Object
-
- org.apache.dvsl.AntLogChute
-
- All Implemented Interfaces:
org.apache.velocity.runtime.log.LogChute
- Direct Known Subclasses:
AntLogSystem
public class AntLogChute extends java.lang.Object implements org.apache.velocity.runtime.log.LogChuteImplementation of a logger to output messages via an Ant Task's log method. Velocity log levels are mapped to corresponding log levels defined in Ant's logging API. The end result is messages will only be output if Ant log level is high enough.- Version:
- $Id:$
- Author:
- Bill Burton
-
-
Field Summary
Fields Modifier and Type Field Description (package private) org.apache.tools.ant.Tasktask
-
Constructor Summary
Constructors Constructor Description AntLogChute(org.apache.tools.ant.Task task)Initialize this logger with a reference to the calling Ant Task
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit(org.apache.velocity.runtime.RuntimeServices rs)Initialize the logger.booleanisLevelEnabled(int level)voidlog(int level, java.lang.String message)Log Velocity messages through the Ant Task log method.voidlog(int level, java.lang.String message, java.lang.Throwable throwable)Log throwables through the Ant Task log method.voidlogVelocityMessage(int level, java.lang.String message)
-
-
-
Method Detail
-
init
public void init(org.apache.velocity.runtime.RuntimeServices rs) throws java.lang.ExceptionInitialize the logger.- Specified by:
initin interfaceorg.apache.velocity.runtime.log.LogChute- Throws:
java.lang.Exception- if null was passed into the constructor
-
log
public void log(int level, java.lang.String message)Log Velocity messages through the Ant Task log method. The mapping of logging levels from Velocity to Ant is as follows:
Velocity Level --> Ant Level LogSystem.TRACE_ID --> Project.MSG_DEBUG LogSystem.DEBUG_ID --> Project.MSG_DEBUG LogSystem.INFO_ID --> Project.MSG_VERBOSE LogSystem.WARN_ID --> Project.MSG_WARN LogSystem.ERROR_ID --> Project.MSG_ERR
- Specified by:
login interfaceorg.apache.velocity.runtime.log.LogChute- Parameters:
level- severity levelmessage- complete error message- See Also:
LogChute,Task.log(String, int)
-
log
public void log(int level, java.lang.String message, java.lang.Throwable throwable)Log throwables through the Ant Task log method. The mapping of logging levels from Velocity to Ant is as follows:
Velocity Level --> Ant Level LogSystem.TRACE_ID --> Project.MSG_DEBUG LogSystem.DEBUG_ID --> Project.MSG_DEBUG LogSystem.INFO_ID --> Project.MSG_VERBOSE LogSystem.WARN_ID --> Project.MSG_WARN LogSystem.ERROR_ID --> Project.MSG_ERR
- Specified by:
login interfaceorg.apache.velocity.runtime.log.LogChute- Parameters:
level- severity levelmessage- complete error messagethrowable- the throwable object to log- See Also:
LogChute,Task.log(String, int)
-
isLevelEnabled
public boolean isLevelEnabled(int level)
- Specified by:
isLevelEnabledin interfaceorg.apache.velocity.runtime.log.LogChute
-
logVelocityMessage
public void logVelocityMessage(int level, java.lang.String message)
-
-