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

array
$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
)'
Maps Phing Project::MSG_* constants to PEAR_LOG_* constants.
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
)Details- Type
- array

boolean
$logConfigured= 'false'
Whether logging has been configured.
falseDetails- Type
- boolean
Methods

buildFinished(
\BuildEvent $event
)
:
voidLogs whether the build succeeded or failed, and any errors that occured during the build. Also outputs the total build-time.
| Name | Type | Description |
|---|---|---|
| $event | \BuildEvent | The BuildEvent |

buildStarted(
\BuildEvent $event
)
:
voidSets the start-time when the build started. Used for calculating the build-time.
| Name | Type | Description |
|---|---|---|
| $event | \BuildEvent | The BuildEvent |

logger(
)
:
\LogGet the configured PEAR logger to use.
This method just ensures that logging has been configured and returns the configured logger.
| Type | Description |
|---|---|
| \Log |

messageLogged(
\BuildEvent $event
)
:
voidLogs a message to the configured PEAR logger.
| Name | Type | Description |
|---|---|---|
| $event | \BuildEvent | The BuildEvent |

targetFinished(
$event
)
:
voidFired when a target has finished. We don't need specific action on this event. So the methods are empty.
@param BuildEvent The BuildEvent
| Name | Type | Description |
|---|---|---|
| $event |
- Access
- public
- See
- \BuildEvent::getException()

targetStarted(
\BuildEvent $event
)
:
voidLogs the current target name
| Name | Type | Description |
|---|---|---|
| $event | \BuildEvent | The BuildEvent |

taskFinished(
\BuildEvent $event
)
:
voidFired when a task has finished. We don't need specific action on this event. So the methods are empty.
| Name | Type | Description |
|---|---|---|
| $event | \BuildEvent | The BuildEvent |

taskStarted(
$event
)
:
voidFired when a task is started. We don't need specific action on this event. So the methods are empty.
@param BuildEvent The BuildEvent
| Name | Type | Description |
|---|---|---|
| $event |
- Access
- public
- See
- \BuildEvent::getTask()