Package org.apache.ant.antunit
Class LogCapturer
- java.lang.Object
-
- org.apache.ant.antunit.LogCapturer
-
- All Implemented Interfaces:
java.util.EventListener,org.apache.tools.ant.BuildListener
public class LogCapturer extends java.lang.Object implements org.apache.tools.ant.BuildListenerCaptures log messages generated during an antunit task run and makes them available to tasks via a project reference.This class captures all messages generated during the build and adds itself as project reference to the project using the id
ant.antunit.log.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringREFERENCE_ID
-
Constructor Summary
Constructors Constructor Description LogCapturer(org.apache.tools.ant.Project p)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildFinished(org.apache.tools.ant.BuildEvent event)De-register.voidbuildStarted(org.apache.tools.ant.BuildEvent event)Empty.java.lang.StringgetDebugLog()All messages withlogLevel == Project.MSG_DEBUGor more severe merging messages into a single line.java.lang.StringgetDebugLog(boolean mergeLines)All messages withlogLevel == Project.MSG_DEBUGor more severe.java.lang.StringgetErrLog()All messages withlogLevel == Project.MSG_ERRmerging messages into a single line.java.lang.StringgetErrLog(boolean mergeLines)All messages withlogLevel == Project.MSG_ERR.java.lang.StringgetInfoLog()All messages withlogLevel == Project.MSG_INFOor more severe merging messages into a single line.java.lang.StringgetInfoLog(boolean mergeLines)All messages withlogLevel == Project.MSG_INFOor more severe.java.lang.StringgetVerboseLog()All messages withlogLevel == Project.MSG_VERBOSEor more severe merging messages into a single line.java.lang.StringgetVerboseLog(boolean mergeLines)All messages withlogLevel == Project.MSG_VERBOSEor more severe.java.lang.StringgetWarnLog()All messages withlogLevel == Project.MSG_WARNor more severe merging messages into a single line.java.lang.StringgetWarnLog(boolean mergeLines)All messages withlogLevel == Project.MSG_WARNor more severe.voidmessageLogged(org.apache.tools.ant.BuildEvent event)Record the message.voidtargetFinished(org.apache.tools.ant.BuildEvent event)Empty.voidtargetStarted(org.apache.tools.ant.BuildEvent event)Empty.voidtaskFinished(org.apache.tools.ant.BuildEvent event)Empty.voidtaskStarted(org.apache.tools.ant.BuildEvent event)Empty.
-
-
-
Field Detail
-
REFERENCE_ID
public static final java.lang.String REFERENCE_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getErrLog
public java.lang.String getErrLog()
All messages withlogLevel == Project.MSG_ERRmerging messages into a single line.- Returns:
- All messages with
logLevel == Project.MSG_ERR
-
getWarnLog
public java.lang.String getWarnLog()
All messages withlogLevel == Project.MSG_WARNor more severe merging messages into a single line.- Returns:
- All messages with
logLevel == Project.MSG_WARNor above
-
getInfoLog
public java.lang.String getInfoLog()
All messages withlogLevel == Project.MSG_INFOor more severe merging messages into a single line.- Returns:
- All messages with
logLevel == Project.MSG_INFOor above
-
getVerboseLog
public java.lang.String getVerboseLog()
All messages withlogLevel == Project.MSG_VERBOSEor more severe merging messages into a single line.- Returns:
- All messages with
logLevel == Project.MSG_VERBOSEor above
-
getDebugLog
public java.lang.String getDebugLog()
All messages withlogLevel == Project.MSG_DEBUGor more severe merging messages into a single line.- Returns:
- All messages with
logLevel == Project.MSG_DEBUGor above
-
getErrLog
public java.lang.String getErrLog(boolean mergeLines)
All messages withlogLevel == Project.MSG_ERR.- Parameters:
mergeLines- whether to merge messages into a single line or split them into multiple lines- Returns:
- All messages with
logLevel == Project.MSG_ERR
-
getWarnLog
public java.lang.String getWarnLog(boolean mergeLines)
All messages withlogLevel == Project.MSG_WARNor more severe.- Parameters:
mergeLines- whether to merge messages into a single line or split them into multiple lines- Returns:
- All messages with
logLevel == Project.MSG_WARNor above - Since:
- AntUnit 1.3
-
getInfoLog
public java.lang.String getInfoLog(boolean mergeLines)
All messages withlogLevel == Project.MSG_INFOor more severe.- Parameters:
mergeLines- whether to merge messages into a single line or split them into multiple lines- Returns:
- All messages with
logLevel == Project.MSG_INFOor above - Since:
- AntUnit 1.3
-
getVerboseLog
public java.lang.String getVerboseLog(boolean mergeLines)
All messages withlogLevel == Project.MSG_VERBOSEor more severe.- Parameters:
mergeLines- whether to merge messages into a single line or split them into multiple lines- Returns:
- All messages with
logLevel == Project.MSG_VERBOSEor above - Since:
- AntUnit 1.3
-
getDebugLog
public java.lang.String getDebugLog(boolean mergeLines)
All messages withlogLevel == Project.MSG_DEBUGor more severe.- Parameters:
mergeLines- whether to merge messages into a single line or split them into multiple lines- Returns:
- All messages with
logLevel == Project.MSG_DEBUGor above - Since:
- AntUnit 1.3
-
buildStarted
public void buildStarted(org.apache.tools.ant.BuildEvent event)
Empty.- Specified by:
buildStartedin interfaceorg.apache.tools.ant.BuildListener
-
targetStarted
public void targetStarted(org.apache.tools.ant.BuildEvent event)
Empty.- Specified by:
targetStartedin interfaceorg.apache.tools.ant.BuildListener
-
targetFinished
public void targetFinished(org.apache.tools.ant.BuildEvent event)
Empty.- Specified by:
targetFinishedin interfaceorg.apache.tools.ant.BuildListener
-
taskStarted
public void taskStarted(org.apache.tools.ant.BuildEvent event)
Empty.- Specified by:
taskStartedin interfaceorg.apache.tools.ant.BuildListener
-
taskFinished
public void taskFinished(org.apache.tools.ant.BuildEvent event)
Empty.- Specified by:
taskFinishedin interfaceorg.apache.tools.ant.BuildListener
-
buildFinished
public void buildFinished(org.apache.tools.ant.BuildEvent event)
De-register.- Specified by:
buildFinishedin interfaceorg.apache.tools.ant.BuildListener
-
messageLogged
public void messageLogged(org.apache.tools.ant.BuildEvent event)
Record the message.- Specified by:
messageLoggedin interfaceorg.apache.tools.ant.BuildListener
-
-