# 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
jump to top

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

`LEFT_COLUMN_SIZE = '12'`

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

@var int

### Properties

`array $levelMap= 'array'`
static

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

Default value `array` Details

Type
  array

`boolean $logConfigured= 'false'`

Whether logging has been configured.

Default value `false` Details

Type
  boolean

`\Log $logger= ''`

PEAR Log object.
Details

Type
  \Log

`$startTime= ''`

Time that the build started

@var int

Details

Type

### Methods

`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()

`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

`configureLogging( ) :`
Configure the logger.
`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 |

`messageLogged( \BuildEvent $event ) :`
Logs a message to the configured PEAR logger.
Parameters

Name | Type | Description
--- | --- | ---
$event | \BuildEvent | The BuildEvent

Details

see
  \BuildEvent::getMessage()

`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()

`targetStarted( \BuildEvent $event ) :`
Logs the current target name
Parameters

Name | Type | Description
--- | --- | ---
$event | \BuildEvent | The BuildEvent

Details

see
  \BuildEvent::getTarget()

`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()

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