phing-listener
[ class tree: phing-listener ] [ index: phing-listener ] [ all elements ]

Class: XmlLogger

Source Location: /listener/XmlLogger.php

Class Overview


Generates a file in the current directory with an XML description of what happened during a build.


Author(s):

Version:

  • $Id: XmlLogger.php 552 2009-08-29 12:18:13Z mrook $

Implements interfaces:

Constants

Methods



Class Details

[line 36]
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

.




Tags:

author:  Michiel Rook <michiel.rook@gmail.com>
version:  $Id: XmlLogger.php 552 2009-08-29 12:18:13Z mrook $


[ Top ]


Class Methods


constructor __construct [line 116]

XmlLogger __construct( )

Constructs a new BuildListener that logs build events to an XML file.



Tags:

access:  public


[ Top ]

method buildFinished [line 141]

void buildFinished( $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.



Tags:

access:  public



Implementation of:
BuildLogger::buildFinished

Parameters:

BuildEvent   $event   An event with any relevant extra information. Will not be
  1. null
.

[ Top ]

method buildStarted [line 127]

void buildStarted( $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.




Implementation of:
BuildLogger::buildStarted

Parameters:

BuildEvent   $event   Ignored.

[ Top ]

method messageLogged [line 265]

void messageLogged( $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.



Tags:

access:  public



Implementation of:
BuildLogger::messageLogged

Parameters:

BuildEvent   $event   An event with any relevant extra information. Will not be
  1. null
.

[ Top ]

method setErrorStream [line 350]

void setErrorStream( $err)

Sets the error stream.



Tags:

see:  setErrorStream()
access:  public



Implementation of:
BuildLogger::setErrorStream

Parameters:

OutputStream   $err  

[ Top ]

method setMessageOutputLevel [line 332]

void setMessageOutputLevel( int $level)

Set 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.




Tags:

see:  setMessageOutputLevel()
access:  public



Implementation of:
BuildLogger::setMessageOutputLevel

Parameters:

int   $level   The logging level for the logger.

[ Top ]

method setOutputStream [line 341]

void setOutputStream( $output)

Sets the output stream.



Tags:

see:  setOutputStream()
access:  public



Implementation of:
BuildLogger::setOutputStream

Parameters:

OutputStream   $output  

[ Top ]

method targetFinished [line 211]

void targetFinished( $event)

Fired when a target finishes building, this adds the time taken to the appropriate target element in the log.



Tags:

access:  public



Implementation of:
BuildLogger::targetFinished

Parameters:

BuildEvent   $event   An event with any relevant extra information. Will not be
  1. null
.

[ Top ]

method targetStarted [line 194]

void targetStarted( $event)

Fired when a target starts building, remembers the current time and the name of the target.



Tags:

access:  public



Implementation of:
BuildLogger::targetStarted

Parameters:

BuildEvent   $event   An event with any relevant extra information. Will not be
  1. null
.

[ Top ]

method taskFinished [line 246]

void taskFinished( $event)

Fired when a task finishes building, this adds the time taken to the appropriate task element in the log.



Tags:

access:  public



Implementation of:
BuildLogger::taskFinished

Parameters:

BuildEvent   $event   An event with any relevant extra information. Will not be
  1. null
.

[ Top ]

method taskStarted [line 228]

void taskStarted( $event)

Fired when a task starts building, remembers the current time and the name of the task.



Tags:

access:  public



Implementation of:
BuildLogger::taskStarted

Parameters:

BuildEvent   $event   An event with any relevant extra information. Will not be
  1. null
.

[ Top ]


Class Constants

BUILD_TAG =  "build"

[line 39]

XML element name for a build.


[ Top ]

ERROR_ATTR =  "error"

[line 63]

XML attribute name for an error description.


[ Top ]

LOCATION_ATTR =  "location"

[line 60]

XML attribute name for a file location.


[ Top ]

MESSAGE_TAG =  "message"

[line 48]

XML element name for a message.


[ Top ]

NAME_ATTR =  "name"

[line 51]

XML attribute name for a name.


[ Top ]

PRIORITY_ATTR =  "priority"

[line 57]

XML attribute name for a message priority.


[ Top ]

STACKTRACE_TAG =  "stacktrace"

[line 66]

XML element name for a stack trace.


[ Top ]

TARGET_TAG =  "target"

[line 42]

XML element name for a target.


[ Top ]

TASK_TAG =  "task"

[line 45]

XML element name for a task.


[ Top ]

TIME_ATTR =  "time"

[line 54]

XML attribute name for a time.


[ Top ]



Documentation generated on Mon, 19 Oct 2009 10:52:24 +0200 by phpDocumentor 1.4.3