public class LogCapturer
extends java.lang.Object
implements org.apache.tools.ant.BuildListener
This class captures all messages generated during the build and
adds itself as project reference to the project using the id
ant.antunit.log
.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REFERENCE_ID |
Constructor and Description |
---|
LogCapturer(org.apache.tools.ant.Project p) |
Modifier and Type | Method and Description |
---|---|
void |
buildFinished(org.apache.tools.ant.BuildEvent event)
De-register.
|
void |
buildStarted(org.apache.tools.ant.BuildEvent event)
Empty.
|
java.lang.String |
getDebugLog()
All messages with
logLevel == Project.MSG_DEBUG or
more severe merging messages into a single line. |
java.lang.String |
getDebugLog(boolean mergeLines)
All messages with
logLevel == Project.MSG_DEBUG or
more severe. |
java.lang.String |
getErrLog()
All messages with
logLevel == Project.MSG_ERR
merging messages into a single line. |
java.lang.String |
getErrLog(boolean mergeLines)
All messages with
logLevel == Project.MSG_ERR . |
java.lang.String |
getInfoLog()
All messages with
logLevel == Project.MSG_INFO or
more severe merging messages into a single line. |
java.lang.String |
getInfoLog(boolean mergeLines)
All messages with
logLevel == Project.MSG_INFO or
more severe. |
java.lang.String |
getVerboseLog()
All messages with
logLevel == Project.MSG_VERBOSE or
more severe merging messages into a single line. |
java.lang.String |
getVerboseLog(boolean mergeLines)
All messages with
logLevel == Project.MSG_VERBOSE or
more severe. |
java.lang.String |
getWarnLog()
All messages with
logLevel == Project.MSG_WARN or
more severe merging messages into a single line. |
java.lang.String |
getWarnLog(boolean mergeLines)
All messages with
logLevel == Project.MSG_WARN or
more severe. |
void |
messageLogged(org.apache.tools.ant.BuildEvent event)
Record the message.
|
void |
targetFinished(org.apache.tools.ant.BuildEvent event)
Empty.
|
void |
targetStarted(org.apache.tools.ant.BuildEvent event)
Empty.
|
void |
taskFinished(org.apache.tools.ant.BuildEvent event)
Empty.
|
void |
taskStarted(org.apache.tools.ant.BuildEvent event)
Empty.
|
public static final java.lang.String REFERENCE_ID
public java.lang.String getErrLog()
logLevel == Project.MSG_ERR
merging messages into a single line.logLevel == Project.MSG_ERR
public java.lang.String getWarnLog()
logLevel == Project.MSG_WARN
or
more severe merging messages into a single line.logLevel == Project.MSG_WARN
or abovepublic java.lang.String getInfoLog()
logLevel == Project.MSG_INFO
or
more severe merging messages into a single line.logLevel == Project.MSG_INFO
or abovepublic java.lang.String getVerboseLog()
logLevel == Project.MSG_VERBOSE
or
more severe merging messages into a single line.logLevel == Project.MSG_VERBOSE
or abovepublic java.lang.String getDebugLog()
logLevel == Project.MSG_DEBUG
or
more severe merging messages into a single line.logLevel == Project.MSG_DEBUG
or abovepublic java.lang.String getErrLog(boolean mergeLines)
logLevel == Project.MSG_ERR
.mergeLines
- whether to merge messages into a single line
or split them into multiple lineslogLevel == Project.MSG_ERR
public java.lang.String getWarnLog(boolean mergeLines)
logLevel == Project.MSG_WARN
or
more severe.mergeLines
- whether to merge messages into a single line
or split them into multiple lineslogLevel == Project.MSG_WARN
or abovepublic java.lang.String getInfoLog(boolean mergeLines)
logLevel == Project.MSG_INFO
or
more severe.mergeLines
- whether to merge messages into a single line
or split them into multiple lineslogLevel == Project.MSG_INFO
or abovepublic java.lang.String getVerboseLog(boolean mergeLines)
logLevel == Project.MSG_VERBOSE
or
more severe.mergeLines
- whether to merge messages into a single line
or split them into multiple lineslogLevel == Project.MSG_VERBOSE
or abovepublic java.lang.String getDebugLog(boolean mergeLines)
logLevel == Project.MSG_DEBUG
or
more severe.mergeLines
- whether to merge messages into a single line
or split them into multiple lineslogLevel == Project.MSG_DEBUG
or abovepublic void buildStarted(org.apache.tools.ant.BuildEvent event)
buildStarted
in interface org.apache.tools.ant.BuildListener
public void targetStarted(org.apache.tools.ant.BuildEvent event)
targetStarted
in interface org.apache.tools.ant.BuildListener
public void targetFinished(org.apache.tools.ant.BuildEvent event)
targetFinished
in interface org.apache.tools.ant.BuildListener
public void taskStarted(org.apache.tools.ant.BuildEvent event)
taskStarted
in interface org.apache.tools.ant.BuildListener
public void taskFinished(org.apache.tools.ant.BuildEvent event)
taskFinished
in interface org.apache.tools.ant.BuildListener
public void buildFinished(org.apache.tools.ant.BuildEvent event)
buildFinished
in interface org.apache.tools.ant.BuildListener
public void messageLogged(org.apache.tools.ant.BuildEvent event)
messageLogged
in interface org.apache.tools.ant.BuildListener