DefaultLogger

Implements \StreamRequiredBuildLogger

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 andi@binarycloud.com

copyright

2001,2002 THYRELL. All rights reserved

version

$Id: 38cf98a16ed15a345603703aa2a93904decf7916 $

see
package

phing.listener

Methods

Construct a new default logger.

__construct() 

Formats a time micro integer to human readable format.

formatTime( $micros) : string
static

Arguments

$micros

Response

string

Get the message to return when a build failed.

getBuildFailedMessage() : string

Response

string

The classic "BUILD FAILED"

Get the message to return when a build succeeded.

getBuildSuccessfulMessage() : string

Response

string

The classic "BUILD FINISHED"

Prints a message to console.

printMessage(string $message, \OutputStream|resource $stream, integer $priority) : void
throws

Arguments

$message

string

The message to print. Should not be null.

$stream

\OutputStream|resource

The stream to use for message printing.

$priority

integer

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

Sets the error stream.

setErrorStream(\OutputStream $err) 
see \BuildLogger#setErrorStream()

Arguments

Set the msgOutputLevel this logger is to respond to.

setMessageOutputLevel(integer $level) 

Only messages with a message level lower than or equal to the given level are output to the log.

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 \BuildLogger#setMessageOutputLevel()

Arguments

$level

integer

The logging level for the logger.

Sets the output stream.

setOutputStream(\OutputStream $output) 
see \BuildLogger#setOutputStream()

Arguments

$output

\OutputStream

Fired when a task has finished. We don't need specific action on this event. So the methods are empty.

taskFinished(\BuildEvent $event) 
see \BuildEvent::getException()

Arguments

$event

\BuildEvent

The BuildEvent

Constants

Size of the left column in output. The default char width is 12.

LEFT_COLUMN_SIZE
var

Properties

The message output level that should be used. The default is <code>Project::MSG_VERBOSE</code>.

msgOutputLevel : integer
var

Type(s)

integer

Time that the build started

startTime : integer
var

Type(s)

integer

Stream to use for standard output.

out : \OutputStream
var

Stream to use for standard output.

Type(s)

\OutputStream

Stream to use for error output.

err : \OutputStream
var

Stream to use for error output.

Type(s)

\OutputStream