listener/PearLogListener.php

Show: inherited
Table of Contents

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
$Id$  

\PearLogListener

Package: phing\listener

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
Parent(s)
\BuildListener
See
\BuildEvent  
Author
Hans Lellelid  
Version
$Id$  

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( Project::MSG_DEBUG => PEAR_LOG_DEBUG, Project::MSG_INFO => PEAR_LOG_INFO, Project::MSG_VERBOSE => PEAR_LOG_NOTICE, Project::MSG_WARN => PEAR_LOG_WARNING, Project::MSG_ERR => PEAR_LOG_ERR )'
static

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

Default valuearray( Project::MSG_DEBUG => PEAR_LOG_DEBUG, Project::MSG_INFO => PEAR_LOG_INFO, Project::MSG_VERBOSE => PEAR_LOG_NOTICE, Project::MSG_WARN => PEAR_LOG_WARNING, Project::MSG_ERR => PEAR_LOG_ERR )Details
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
n/a

Methods

methodpublicbuildFinished( \BuildEvent $event ) : void

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()  
methodpublicbuildStarted( \BuildEvent $event ) : void

Sets the start-time when the build started. Used for calculating the build-time.

Parameters
Name Type Description
$event \BuildEvent

The BuildEvent

methodprotectedconfigureLogging( ) : void

Configure the logger.

methodprotectedlogger( ) : \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
methodpublicmessageLogged( \BuildEvent $event ) : void

Logs a message to the configured PEAR logger.

Parameters
Name Type Description
$event \BuildEvent

The BuildEvent

Details
See
\BuildEvent::getMessage()  
methodpublictargetFinished(  $event ) : void

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()  
methodpublictargetStarted( \BuildEvent $event ) : void

Logs the current target name

Parameters
Name Type Description
$event \BuildEvent

The BuildEvent

Details
See
\BuildEvent::getTarget()  
methodpublictaskFinished( \BuildEvent $event ) : void

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()  
methodpublictaskStarted(  $event ) : void

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