PHP Class PearLogListener, symfony-1.4

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
See also: BuildEvent
Author: Hans Lellelid ([email protected])
Inheritance: implements BuildListener
Show file Open project: vjousse/symfony-1.4

Protected Properties

Property Type Description
$levelMap array Maps Phing Project::MSG_* constants to PEAR_LOG_* constants.
$logConfigured boolean Whether logging has been configured.
$logger PEAR Log object.
$startTime integer @var int

Public Methods

Method Description
buildFinished ( BuildEvent $event ) Logs whether the build succeeded or failed, and any errors that occured during the build. Also outputs the total build-time.
buildStarted ( BuildEvent $event ) Sets the start-time when the build started. Used for calculating the build-time.
messageLogged ( BuildEvent $event ) Logs a message to the configured PEAR logger.
targetFinished ( BuildEvent $event ) Fired when a target has finished. We don't need specific action on this event. So the methods are empty.
targetStarted ( BuildEvent $event ) Logs the current target name
taskFinished ( BuildEvent $event ) Fired when a task has finished. We don't need specific action on this event. So the methods are empty.
taskStarted ( BuildEvent $event ) Fired when a task is started. We don't need specific action on this event. So the methods are empty.

Protected Methods

Method Description
configureLogging ( ) Configure the logger.
logger ( ) : Log Get the configured PEAR logger to use.

Method Details

buildFinished() public method

Logs whether the build succeeded or failed, and any errors that occured during the build. Also outputs the total build-time.
See also: BuildEvent::getException()
public buildFinished ( BuildEvent $event )
$event BuildEvent

buildStarted() public method

Sets the start-time when the build started. Used for calculating the build-time.
public buildStarted ( BuildEvent $event )
$event BuildEvent

configureLogging() protected method

Configure the logger.
protected configureLogging ( )

logger() protected method

This method just ensures that logging has been configured and returns the configured logger.
protected logger ( ) : Log
return Log

messageLogged() public method

Logs a message to the configured PEAR logger.
See also: BuildEvent::getMessage()
public messageLogged ( BuildEvent $event )
$event BuildEvent

targetFinished() public method

@param BuildEvent The BuildEvent
public targetFinished ( BuildEvent $event )
$event BuildEvent

targetStarted() public method

Logs the current target name
See also: BuildEvent::getTarget()
public targetStarted ( BuildEvent $event )
$event BuildEvent

taskFinished() public method

Fired when a task has finished. We don't need specific action on this event. So the methods are empty.
See also: BuildEvent::getException()
public taskFinished ( BuildEvent $event )
$event BuildEvent

taskStarted() public method

@param BuildEvent The BuildEvent
public taskStarted ( BuildEvent $event )
$event BuildEvent

Property Details

$levelMap protected static property

Maps Phing Project::MSG_* constants to PEAR_LOG_* constants.
protected static array $levelMap
return array

$logConfigured protected property

Whether logging has been configured.
protected bool $logConfigured
return boolean

$logger protected property

PEAR Log object.
protected $logger

$startTime protected property

@var int
protected int $startTime
return integer