| java.lang.Object org.apache.tools.ant.XmlLogger
XmlLogger | public class XmlLogger implements BuildLogger(Code) | | Generates a file in the current directory with
an XML description of what happened during a build.
The default filename is "log.xml", but this can be overridden
with the property XmlLogger.file .
This implementation assumes in its sanity checking that only one
thread runs a particular target/task at a time. This is enforced
by the way that parallel builds and antcalls are done - and
indeed all but the simplest of tasks could run into problems
if executed in parallel.
See Also: Project.addBuildListener(BuildListener) |
Constructor Summary | |
public | XmlLogger() Constructs a new BuildListener that logs build events to an XML file. |
Method Summary | |
public void | buildFinished(BuildEvent event) Fired when the build finishes, this adds the time taken and any
error stacktrace to the build element and writes the document to disk. | public void | buildStarted(BuildEvent event) Fired when the build starts, this builds the top-level element for the
document and remembers the time of the start of the build. | public void | messageLogged(BuildEvent event) Fired when a message is logged, this adds a message element to the
most appropriate parent element (task, target or build) and records
the priority and text of the message. | public void | setEmacsMode(boolean emacsMode) | public void | setErrorPrintStream(PrintStream err) Ignore error print stream. | public void | setMessageOutputLevel(int level) | public void | setOutputPrintStream(PrintStream output) Set the output stream to which logging output is sent when operating
as a logger. | public void | targetFinished(BuildEvent event) Fired when a target finishes building, this adds the time taken
and any error stacktrace to the appropriate target element in the log. | public void | targetStarted(BuildEvent event) Fired when a target starts building, this pushes a timed element
for the target onto the stack of elements for the current thread,
remembering the current time and the name of the target. | public void | taskFinished(BuildEvent event) Fired when a task finishes building, this adds the time taken
and any error stacktrace to the appropriate task element in the log. | public void | taskStarted(BuildEvent event) Fired when a task starts building, this pushes a timed element
for the task onto the stack of elements for the current thread,
remembering the current time and the name of the task. |
XmlLogger | public XmlLogger()(Code) | | Constructs a new BuildListener that logs build events to an XML file.
|
buildFinished | public void buildFinished(BuildEvent event)(Code) | | Fired when the build finishes, this adds the time taken and any
error stacktrace to the build element and writes the document to disk.
Parameters: event - An event with any relevant extra information.Will not be null . |
buildStarted | public void buildStarted(BuildEvent event)(Code) | | Fired when the build starts, this builds the top-level element for the
document and remembers the time of the start of the build.
Parameters: event - Ignored. |
messageLogged | public void messageLogged(BuildEvent event)(Code) | | Fired when a message is logged, this adds a message element to the
most appropriate parent element (task, target or build) and records
the priority and text of the message.
Parameters: event - An event with any relevant extra information.Will not be null . |
setEmacsMode | public void setEmacsMode(boolean emacsMode)(Code) | | Ignore emacs mode, as it has no meaning in XML format
Parameters: emacsMode - true if logger should produce emacs compatibleoutput |
setErrorPrintStream | public void setErrorPrintStream(PrintStream err)(Code) | | Ignore error print stream. All output will be written to
either the XML log file or the PrintStream provided to
setOutputPrintStream
Parameters: err - the stream we are going to ignore. |
setMessageOutputLevel | public void setMessageOutputLevel(int level)(Code) | | Set the logging level when using this as a Logger
Parameters: level - the logging level -see org.apache.tools.ant.Project.MSG_ERR Projectclass for level definitions |
setOutputPrintStream | public void setOutputPrintStream(PrintStream output)(Code) | | Set the output stream to which logging output is sent when operating
as a logger.
Parameters: output - the output PrintStream. |
targetFinished | public void targetFinished(BuildEvent event)(Code) | | Fired when a target finishes building, this adds the time taken
and any error stacktrace to the appropriate target element in the log.
Parameters: event - An event with any relevant extra information.Will not be null . |
targetStarted | public void targetStarted(BuildEvent event)(Code) | | Fired when a target starts building, this pushes a timed element
for the target onto the stack of elements for the current thread,
remembering the current time and the name of the target.
Parameters: event - An event with any relevant extra information.Will not be null . |
taskFinished | public void taskFinished(BuildEvent event)(Code) | | Fired when a task finishes building, this adds the time taken
and any error stacktrace to the appropriate task element in the log.
Parameters: event - An event with any relevant extra information.Will not be null . |
taskStarted | public void taskStarted(BuildEvent event)(Code) | | Fired when a task starts building, this pushes a timed element
for the task onto the stack of elements for the current thread,
remembering the current time and the name of the task.
Parameters: event - An event with any relevant extra information.Will not be null . |
|
|