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
version $Id$
see \global\BuildEvent
package phing.listener

 Methods

Construct a new default logger.

__construct() 

Prints whether the build succeeded or failed, and any errors that occured during the build.

buildFinished(\BuildEvent $event) 

Also outputs the total build-time.

Parameters

$event

object

The BuildEvent @see BuildEvent::getException()

Sets the start-time when the build started.

buildStarted(\BuildEvent $event) 

Used for calculating the build-time.

Parameters

$event

object

The BuildEvent @access public

Formats a time micro integer to human readable format.

formatTime($micros) 
Static

@param integer The time stamp

access private

Parameters

$micros

Sets the error stream.

setErrorStream(\OutputStream $err) 

Set the msgOutputLevel this logger is to respond to.

setMessageOutputLevel(int $level) 

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.

see \global\BuildLogger#setMessageOutputLevel()

Parameters

$level

int

The logging level for the logger.

Sets the output stream.

setOutputStream(\OutputStream $output) 

Fired when a target has finished.

targetFinished(\BuildEvent $event) 

We don't need specific action on this event. So the methods are empty.

Parameters

$event

object

The BuildEvent @see BuildEvent::getException()

Fired when a task has finished.

taskFinished(\BuildEvent $event) 

We don't need specific action on this event. So the methods are empty.

Parameters

$event

object

The BuildEvent @access public @see BuildEvent::getException()

Fired when a task is started.

taskStarted(\BuildEvent $event) 

We don't need specific action on this event. So the methods are empty.

Parameters

$event

object

The BuildEvent @access public @see BuildEvent::getTask()

Get the message to return when a build failed.

getBuildFailedMessage() : string

Returns

stringThe classic "BUILD FAILED"

Get the message to return when a build succeeded.

getBuildSuccessfulMessage() : string

Returns

stringThe classic "BUILD FINISHED"

Prints a message to console.

printMessage(string $message, \OutputStream $stream, int $priority) : void

Parameters

$message

string

The message to print. Should not be null.

$stream

resource

The stream to use for message printing.

$priority

int

The priority of the message. (Ignored in this implementation.)

 Properties

 

Stream to use for error output.

$err : \OutputStream
 

$msgOutputLevel : int

The default is

Project::MSG_VERBOSE

.

 

Stream to use for standard output.

$out : \OutputStream
 

$startTime 

@var int

 Constants

 

Size of the left column in output.

LEFT_COLUMN_SIZE : int

The default char width is 12.