classes/phing/listener/DefaultLogger.php

\DefaultLogger

Writes a build event to the console.

Currently, it only writes which targets are being executed, and any messages that get logged.

Implements
\StreamRequiredBuildLogger
see
\BuildEvent
author
Andreas Aderhold
copyright
2001,2002 THYRELL. All rights reserved
package
phing.listener
version
$Revision: 912 $ $Date: 2010-10-12 03:08:31 +0200 (Tue, 12 Oct 2010) $

Constants

Constant  LEFT_COLUMN_SIZE = '12'

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

@var int

Properties

Propertyprotected\OutputStream  $err= ''

Stream to use for error output.
Details
Type
\OutputStream
Propertyprotected  $msgOutputLevel= 'Project'

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

@var int

Default valueProjectDetails
Type
Propertyprotected\OutputStream  $out= ''

Stream to use for standard output.
Details
Type
\OutputStream
Propertyprotected  $startTime= ''

Time that the build started

@var int

Details
Type

Methods

methodpublic  __construct( ) :
Construct a new default logger.
methodpublic  buildFinished(  $event ) :
Prints whether the build succeeded or failed, and any errors that occured during the build. Also outputs the total build-time.

@param object The BuildEvent

Parameters
Name Type Description
$event
Details
see
\BuildEvent::getException()
methodpublic  buildStarted(  $event ) :
Sets the start-time when the build started. Used for calculating the build-time.

@param object The BuildEvent

Parameters
Name Type Description
$event
Details
access
public
methodpublic  formatTime(  $micros ) :
staticFormats a time micro integer to human readable format.

@param integer The time stamp

Parameters
Name Type Description
$micros
Details
access
private
methodprotected  getBuildFailedMessage( ) : string
Get the message to return when a build failed.
Returns
Type Description
string
methodprotected  getBuildSuccessfulMessage( ) : string
Get the message to return when a build succeeded.
Returns
Type Description
string
methodpublic  messageLogged(  $event ) :
Print a message to the stdout.

@param object The BuildEvent

Parameters
Name Type Description
$event
Details
access
public
see
\BuildEvent::getMessage()
methodprotected  printMessage( string $message, resource $stream, int $priority ) : void
Prints a message to console.
Parameters
Name Type Description
$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.)

methodpublic  setErrorStream( \OutputStream $err ) :
Sets the error stream.
Parameters
Name Type Description
$err \OutputStream
Details
see
\BuildLogger#setErrorStream()
methodpublic  setMessageOutputLevel( int $level ) :
Set 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.

Parameters
Name Type Description
$level int The logging level for the logger.
Details
see
\BuildLogger#setMessageOutputLevel()
methodpublic  setOutputStream( \OutputStream $output ) :
Sets the output stream.
Parameters
Name Type Description
$output \OutputStream
Details
see
\BuildLogger#setOutputStream()
methodpublic  targetFinished(  $event ) :
Fired when a target has finished. We don't need specific action on this event. So the methods are empty.

@param object The BuildEvent

Parameters
Name Type Description
$event
Details
see
\BuildEvent::getException()
methodpublic  targetStarted(  $event ) :
Prints the current target name

@param object The BuildEvent

Parameters
Name Type Description
$event
Details
access
public
see
\BuildEvent::getTarget()
methodpublic  taskFinished(  $event ) :
Fired when a task has finished. We don't need specific action on this event. So the methods are empty.

@param object The BuildEvent

Parameters
Name Type Description
$event
Details
access
public
see
\BuildEvent::getException()
methodpublic  taskStarted(  $event ) :
Fired when a task is started. We don't need specific action on this event. So the methods are empty.

@param object The BuildEvent

Parameters
Name Type Description
$event
Details
access
public
see
\BuildEvent::getTask()
Documentation was generated by DocBlox 0.13.1.