listener/DefaultLogger.php
Writes a build event to the console.
Currently, it only writes which targets are being executed, and any messages that get logged.
- Author
- Andreas Aderhold
- Copyright
- 2001,2002 THYRELL. All rights reserved
- Package
- phing.listener
- See
- \BuildEvent
- Version
- $Id$
\DefaultLogger
Writes a build event to the console.
Currently, it only writes which targets are being executed, and any messages that get logged.
- Parent(s)
- \StreamRequiredBuildLogger < \BuildLogger < \BuildListener
- Children
- \HtmlColorLogger
- \NoBannerLogger
- \AnsiColorLogger
- \MailLogger
- See
- \BuildEvent
- Author
- Andreas Aderhold
- Copyright
- 2001,2002 THYRELL. All rights reserved
- Version
- $Id$
Constants
Properties

$msgOutputLevel= 'Project::MSG_ERR'
The message output level that should be used. The default is <code>Project::MSG_VERBOSE</code>.
@var int
Project::MSG_ERRDetails- Type
- n/a
Methods

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

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

formatTime(
$micros
)
:
voidFormats a time micro integer to human readable format.
@param integer The time stamp
| Name | Type | Description |
|---|---|---|
| $micros |
- Access
- private

getBuildFailedMessage(
)
:
stringGet the message to return when a build failed.
| Type | Description |
|---|---|
| string | The classic "BUILD FAILED" |

getBuildSuccessfulMessage(
)
:
stringGet the message to return when a build succeeded.
| Type | Description |
|---|---|
| string | The classic "BUILD FINISHED" |

messageLogged(
$event
)
:
voidPrint a message to the stdout.
@param object The BuildEvent
| Name | Type | Description |
|---|---|---|
| $event |
- Access
- public
- See
- \BuildEvent::getMessage()

printMessage(
string $message, resource $stream, int $priority
)
:
voidPrints a message to console.
| Name | Type | Description |
|---|---|---|
| $message | string | The message to print. Should not be |
| $stream | resource | The stream to use for message printing. |
| $priority | int | The priority of the message. (Ignored in this implementation.) |

setErrorStream(
\OutputStream $err
)
:
voidSets the error stream.
| Name | Type | Description |
|---|---|---|
| $err | \OutputStream |
- See
- \BuildLogger#setErrorStream()

setMessageOutputLevel(
int $level
)
:
voidSet the msgOutputLevel this logger is to respond to.
Only messages with a message level lower than or equal to the given level are output to the log.
<
p> Constants for the message levels are in Project.php. The order of the levels, from least to most verbose, is:
- Project::MSG_ERR
- Project::MSG_WARN
- Project::MSG_INFO
- Project::MSG_VERBOSE
- Project::MSG_DEBUG
The default message level for DefaultLogger is Project::MSG_ERR.
| Name | Type | Description |
|---|---|---|
| $level | int | The logging level for the logger. |
- See
- \BuildLogger#setMessageOutputLevel()

setOutputStream(
\OutputStream $output
)
:
voidSets the output stream.
| Name | Type | Description |
|---|---|---|
| $output | \OutputStream |
- See
- \BuildLogger#setOutputStream()

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

targetStarted(
$event
)
:
voidPrints the current target name
@param object The BuildEvent
| Name | Type | Description |
|---|---|---|
| $event |
- Access
- public
- See
- \BuildEvent::getTarget()

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

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