classes/phing/listener/PearLogListener.php

Writes build messages to PEAR Log.

By default it will log to file in current directory w/ name 'phing.log'. You can customize this behavior by setting properties: - pear.log.type - pear.log.name - pear.log.ident (note that this class changes ident to project name) - pear.log.conf (note that array values are currently unsupported in Phing property files)

phing -f build.xml -logger phing.listener.PearLogger -Dpear.log.type=file -Dpear.log.name=/path/to/log.log

author
Hans Lellelid
package
phing.listener
see
\BuildEvent
version
$Revision: 552 $ $Date: 2009-08-29 14:18:13 +0200 (Sat, 29 Aug 2009) $

\PearLogListener

Writes build messages to PEAR Log.

By default it will log to file in current directory w/ name 'phing.log'. You can customize this behavior by setting properties: - pear.log.type - pear.log.name - pear.log.ident (note that this class changes ident to project name) - pear.log.conf (note that array values are currently unsupported in Phing property files)

phing -f build.xml -logger phing.listener.PearLogger -Dpear.log.type=file -Dpear.log.name=/path/to/log.log

Implements
\BuildListener
see
\BuildEvent
author
Hans Lellelid
package
phing.listener
version
$Revision: 552 $ $Date: 2009-08-29 14:18:13 +0200 (Sat, 29 Aug 2009) $

Constants

Constant  LEFT_COLUMN_SIZE = '12'

Size of the left column in output. The default char width is 12.

@var int

Properties

Propertyprotectedarray  $levelMap= 'array'
static

Maps Phing Project::MSG_* constants to PEAR_LOG_* constants.

Default valuearrayDetails
Type
array
Propertyprotectedboolean  $logConfigured= 'false'

Whether logging has been configured.

Default valuefalseDetails
Type
boolean
Propertyprotected\Log  $logger= ''

PEAR Log object.
Details
Type
\Log
Propertyprotected  $startTime= ''

Time that the build started

@var int

Details
Type

Methods

methodpublic  buildFinished( \BuildEvent $event ) :
Logs whether the build succeeded or failed, and any errors that occured during the build. Also outputs the total build-time.
Parameters
Name Type Description
$event \BuildEvent The BuildEvent
Details
see
\BuildEvent::getException()
methodpublic  buildStarted( \BuildEvent $event ) :
Sets the start-time when the build started. Used for calculating the build-time.
Parameters
Name Type Description
$event \BuildEvent The BuildEvent
methodprotected  configureLogging( ) :
Configure the logger.
methodprotected  logger( ) : \Log
Get the configured PEAR logger to use.

This method just ensures that logging has been configured and returns the configured logger.

Returns
Type Description
\Log
methodpublic  messageLogged( \BuildEvent $event ) :
Logs a message to the configured PEAR logger.
Parameters
Name Type Description
$event \BuildEvent The BuildEvent
Details
see
\BuildEvent::getMessage()
methodpublic  targetFinished(  $event ) :
Fired when a target has finished. We don't need specific action on this event. So the methods are empty.

@param BuildEvent The BuildEvent

Parameters
Name Type Description
$event
Details
access
public
see
\BuildEvent::getException()
methodpublic  targetStarted( \BuildEvent $event ) :
Logs the current target name
Parameters
Name Type Description
$event \BuildEvent The BuildEvent
Details
see
\BuildEvent::getTarget()
methodpublic  taskFinished( \BuildEvent $event ) :
Fired when a task has finished. We don't need specific action on this event. So the methods are empty.
Parameters
Name Type Description
$event \BuildEvent The BuildEvent
Details
see
\BuildEvent::getException()
methodpublic  taskStarted(  $event ) :
Fired when a task is started. We don't need specific action on this event. So the methods are empty.

@param BuildEvent The BuildEvent

Parameters
Name Type Description
$event
Details
access
public
see
\BuildEvent::getTask()
Documentation was generated by DocBlox 0.13.1.