MailLogger

Extends \DefaultLogger

Uses PEAR Mail package to send the build log to one or more recipients.

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

author

Michiel Rook [email protected]

package

phing.listener

version

$Id: 5ede8a61eb71e0998933f7da4d5aa4a0104fef38 $

Methods

Construct a new default logger.

__construct() 
inherited

Prints whether the build succeeded or failed, and any errors that occurred during the build. Also outputs the total build-time.

buildFinished(\BuildEvent $event) 
inherited

Sets the start-time when the build started. Used for calculating the build-time.

buildStarted(\BuildEvent $event) 
inherited

Arguments

$event

\BuildEvent

Formats a time micro integer to human readable format.

formatTime( $micros) : string
inherited static

Arguments

$micros

Response

string

Get the message to return when a build failed.

getBuildFailedMessage() : string
inherited

Response

string

The classic "BUILD FAILED"

Get the message to return when a build succeeded.

getBuildSuccessfulMessage() : string
inherited

Response

string

The classic "BUILD FINISHED"

getValue

getValue(array $properties, string $name, mixed $defaultValue) : mixed
Throws
\BadMethodCallException

Arguments

$properties

array

$name

string

$defaultValue

mixed

Response

mixed

Print a message to the stdout.

messageLogged(\BuildEvent $event) 
inherited
see \BuildEvent::getMessage()

Arguments

$event

\BuildEvent

Prints a message to console.

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

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 this logger to produce emacs (and other editor) friendly output.

setEmacsMode(boolean $emacsMode) 
inherited

Arguments

$emacsMode

boolean

true if output is to be unadorned so that emacs and other editors can parse files names, etc.

Sets the error stream.

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

Arguments

Set the msgOutputLevel this logger is to respond to.

setMessageOutputLevel(integer $level) 
inherited

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) 
inherited
see \BuildLogger#setOutputStream()

Arguments

$output

\OutputStream

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

targetFinished(\BuildEvent $event) 
inherited

Prints the current target name

targetStarted(\BuildEvent $event) 
inherited
see \BuildEvent::getTarget()

Arguments

$event

\BuildEvent

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

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

Arguments

$event

\BuildEvent

The BuildEvent

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

taskStarted(\BuildEvent $event) 
inherited
see \BuildEvent::getTask()

Arguments

$event

\BuildEvent

throwableMessage

throwableMessage( &$msg,  $error,  $verbose) 
inherited static

Arguments

$msg

$error

$verbose

Constants

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

LEFT_COLUMN_SIZE
inherited
var

Properties

mailMessage

mailMessage : 

Type(s)

from

from : 

Type(s)

tolist

tolist : 

Type(s)

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

msgOutputLevel : integer
inherited
var

Type(s)

integer

Time that the build started

startTime : integer
inherited
var

Type(s)

integer

Stream to use for standard output.

out : \OutputStream
inherited
var

Stream to use for standard output.

Type(s)

\OutputStream

Stream to use for error output.

err : \OutputStream
inherited
var

Stream to use for error output.

Type(s)

\OutputStream

emacsMode

emacsMode : 
inherited

Type(s)