listener/XmlLogger.php
$Id: XmlLogger.php 552 2009-08-29 12:18:13Z mrook $
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many individuals and is licensed under the LGPL. For more information please see http://phing.info.
\XmlLogger
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
.
- Implements
- \BuildLogger
- Author
- Michiel Rook
- Version
- $Id: XmlLogger.php 552 2009-08-29 12:18:13Z mrook $
Constants
Properties

array
$elementStack= 'array()'
array()Details- Type
- array
Methods

buildFinished(
\BuildEvent $event
)
:
voidFired when the build finishes, this adds the time taken and any error stacktrace to the build element and writes the document to disk.
| Name | Type | Description |
|---|---|---|
| $event | \BuildEvent | An event with any relevant extra information. Will not be |

buildStarted(
\BuildEvent $event
)
:
voidFired when the build starts, this builds the top-level element for the document and remembers the time of the start of the build.
| Name | Type | Description |
|---|---|---|
| $event | \BuildEvent | Ignored. |

messageLogged(
\BuildEvent $event
)
:
voidFired 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.
@param BuildEvent The BuildEvent
| Name | Type | Description |
|---|---|---|
| $event | \BuildEvent | An event with any relevant extra information. Will not be |

setMessageOutputLevel(
int $level
)
:
voidSet the msgOutputLevel this logger is to respond to.
Only messages with a message level lower than or equal to the given level are output to the log.
<
p> Constants for the message levels are in Project.php. The order of the levels, from least to most verbose, is:
- Project::MSG_ERR
- Project::MSG_WARN
- Project::MSG_INFO
- Project::MSG_VERBOSE
- Project::MSG_DEBUG
The default message level for DefaultLogger is Project::MSG_ERR.
| Name | Type | Description |
|---|---|---|
| $level | int | The logging level for the logger. |
- See
- \BuildLogger#setMessageOutputLevel()

targetFinished(
\BuildEvent $event
)
:
voidFired when a target finishes building, this adds the time taken to the appropriate target element in the log.
| Name | Type | Description |
|---|---|---|
| $event | \BuildEvent | An event with any relevant extra information. Will not be |

targetStarted(
\BuildEvent $event
)
:
voidFired when a target starts building, remembers the current time and the name of the target.
| Name | Type | Description |
|---|---|---|
| $event | \BuildEvent | An event with any relevant extra information. Will not be |

taskFinished(
\BuildEvent $event
)
:
voidFired when a task finishes building, this adds the time taken to the appropriate task element in the log.
@param BuildEvent The BuildEvent
| Name | Type | Description |
|---|---|---|
| $event | \BuildEvent | An event with any relevant extra information. Will not be |

taskStarted(
\BuildEvent $event
)
:
voidFired when a task starts building, remembers the current time and the name of the task.
| Name | Type | Description |
|---|---|---|
| $event | \BuildEvent | An event with any relevant extra information. Will not be |