|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.dvsl.AntLogChute
public class AntLogChute
Implementation 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.
Field Summary | |
---|---|
(package private) org.apache.tools.ant.Task |
task
|
Fields inherited from interface org.apache.velocity.runtime.log.LogChute |
---|
DEBUG_ID, DEBUG_PREFIX, ERROR_ID, ERROR_PREFIX, INFO_ID, INFO_PREFIX, TRACE_ID, TRACE_PREFIX, WARN_ID, WARN_PREFIX |
Constructor Summary | |
---|---|
AntLogChute(org.apache.tools.ant.Task task)
Initialize this logger with a reference to the calling Ant Task |
Method Summary | |
---|---|
void |
init(org.apache.velocity.runtime.RuntimeServices rs)
Initialize the logger. |
boolean |
isLevelEnabled(int level)
|
void |
log(int level,
java.lang.String message)
Log Velocity messages through the Ant Task log method. |
void |
log(int level,
java.lang.String message,
java.lang.Throwable throwable)
Log throwables through the Ant Task log method. |
void |
logVelocityMessage(int level,
java.lang.String message)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
org.apache.tools.ant.Task task
Constructor Detail |
---|
public AntLogChute(org.apache.tools.ant.Task task)
task
- Ant Task to use for logging. This must not be null.Method Detail |
---|
public void init(org.apache.velocity.runtime.RuntimeServices rs) throws java.lang.Exception
init
in interface org.apache.velocity.runtime.log.LogChute
java.lang.Exception
- if null was passed into the constructorpublic 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
log
in interface org.apache.velocity.runtime.log.LogChute
level
- severity levelmessage
- complete error messageLogChute
,
Task.log(String, int)
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
log
in interface org.apache.velocity.runtime.log.LogChute
level
- severity levelmessage
- complete error messagethrowable
- the throwable object to logLogChute
,
Task.log(String, int)
public boolean isLevelEnabled(int level)
isLevelEnabled
in interface org.apache.velocity.runtime.log.LogChute
public void logVelocityMessage(int level, java.lang.String message)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |