# 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

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

Implements
  \BuildListener
See
  \BuildEvent
Author
  Hans Lellelid
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( Project::MSG_DEBUG => PEAR_LOG_DEBUG'`
static

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

Default value `array( Project::MSG_DEBUG => PEAR_LOG_DEBUG` 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 ) : 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()

`buildStarted( \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

`configureLogging( ) : void`

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 ) : void`

Logs a message to the configured PEAR logger.

@param BuildEvent The BuildEvent

Parameters

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

Details

See
  \BuildEvent::getMessage()

`targetFinished( \BuildEvent $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 | \BuildEvent | The BuildEvent

Details

Access
  public
See
  \BuildEvent::getException()

`targetStarted( \BuildEvent $event ) : void`

Logs the current target name

Parameters

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

Details

See
  \BuildEvent::getTarget()

`taskFinished( \BuildEvent $event ) : void`

Fired when a task 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 | \BuildEvent | The BuildEvent

Details

See
  \BuildEvent::getException()

`taskStarted( \BuildEvent $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 | \BuildEvent | The BuildEvent

Details

Access
  public
See
  \BuildEvent::getTask()

Documentation was generated by DocBlox 0.15.1.