HtmlColorLogger

Extends \DefaultLogger

Uses CSS class that must be defined in the HTML page where the Phing output is displayed.

If used with the -logfile option, the output will contain the text wrapped in html elements with those css classes.

The default classes used for differentiating the message levels can be changed by editing the phing/listener/defaults.properties file.

This file can contain 5 key/value pairs: HtmlColorLogger.ERROR_CLASS=your_css_class_name HtmlColorLogger.WARNING_CLASS=your_css_class_name HtmlColorLogger.INFO_CLASS=your_css_class_name HtmlColorLogger.VERBOSE_CLASS=your_css_class_name HtmlColorLogger.DEBUG_CLASS=your_css_class_name

This stems from the Ansi Color Logger done by Hans Lellelid:

author

Anton Stöckl anton@stoeckl.de (Phing HTML Color Logger)

author

Hans Lellelid hans@xmpl.org (Phing Ansi Color Logger)

author

Magesh Umasankar (Ant)

package

phing.listener

version

$Id: 4b57f4d435b61b6501688394f1ff8534d4b7e93f $

Methods

Construct a new default logger.

__construct() 
inherited

Set the colors to use from a property file specified in the special phing property file "phing/listener/defaults.properties".

setColors() 
final

Prints a message to console.

printMessage(string $message, resource $stream, int $priority) : void
inherited

Arguments

$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.)

Set the msgOutputLevel this logger is to respond to.

setMessageOutputLevel(int $level) 
inherited

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

Arguments

$level

int

The logging level for the logger.

Sets the output stream.

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

Arguments

$output

\OutputStream

Sets the error stream.

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

Arguments

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

buildStarted(\BuildEvent $event) 
inherited

@param object The BuildEvent

access

public

Arguments

$event

\BuildEvent

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

buildFinished(\BuildEvent $event) 
inherited

@param object The BuildEvent

see \BuildEvent::getException()

Arguments

$event

\BuildEvent

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"

Prints the current target name

targetStarted(\BuildEvent $event) 
inherited

@param object The BuildEvent

access

public @see BuildEvent::getTarget()

Arguments

$event

\BuildEvent

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

targetFinished(\BuildEvent $event) 
inherited

@param object The BuildEvent

see \BuildEvent::getException()

Arguments

$event

\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

@param object The BuildEvent

access

public @see BuildEvent::getTask()

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

@param object The BuildEvent

access

public @see BuildEvent::getException()

Arguments

$event

\BuildEvent

Print a message to the stdout.

messageLogged(\BuildEvent $event) 
inherited

@param object The BuildEvent

access

public @see BuildEvent::getMessage()

Arguments

$event

\BuildEvent

Formats a time micro integer to human readable format.

formatTime($micros) 
inherited static

@param integer The time stamp

access

private

Arguments

$micros

Constants

CLASS_ERR

CLASS_ERR

CLASS_VERBOSE

CLASS_VERBOSE

CLASS_DEBUG

CLASS_DEBUG

CLASS_WARN

CLASS_WARN

CLASS_INFO

CLASS_INFO

PREFIX

PREFIX

SUFFIX

SUFFIX

END_COLOR

END_COLOR

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

LEFT_COLUMN_SIZE
inherited

@var int

Properties

errColor

errColor : 

warnColor

warnColor : 

infoColor

infoColor : 

verboseColor

verboseColor : 

debugColor

debugColor : 

colorsSet

colorsSet : 

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

msgOutputLevel : 
inherited

@var int

Time that the build started

startTime : 
inherited

@var int

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