PHP Class DefaultLogger, symfony-1.4

Currently, it only writes which targets are being executed, and any messages that get logged.
See also: BuildEvent
Author: Andreas Aderhold ([email protected])
Inheritance: implements StreamRequiredBuildLogger
Afficher le fichier Open project: vjousse/symfony-1.4 Class Usage Examples

Protected Properties

Свойство Type Description
$err Stream to use for error output.
$msgOutputLevel integer @var int
$out Stream to use for standard output.
$startTime integer @var int

Méthodes publiques

Méthode Description
__construct ( ) Construct a new default logger.
buildFinished ( BuildEvent $event ) Prints whether the build succeeded or failed, and any errors that occured during the build. Also outputs the total build-time.
buildStarted ( BuildEvent $event ) Sets the start-time when the build started. Used for calculating the build-time.
formatTime ( $micros ) Formats a time micro integer to human readable format.
messageLogged ( BuildEvent $event ) Print a message to the stdout.
setErrorStream ( OutputStream $err ) Sets the error stream.
setMessageOutputLevel ( integer $level ) Set the msgOutputLevel this logger is to respond to.
setOutputStream ( OutputStream $output ) Sets the output stream.
targetFinished ( BuildEvent $event ) Fired when a target has finished. We don't need specific action on this event. So the methods are empty.
targetStarted ( BuildEvent $event ) Prints the current target name
taskFinished ( BuildEvent $event ) Fired when a task has finished. We don't need specific action on this event. So the methods are empty.
taskStarted ( BuildEvent $event ) Fired when a task is started. We don't need specific action on this event. So the methods are empty.

Méthodes protégées

Méthode Description
getBuildFailedMessage ( ) : string Get the message to return when a build failed.
getBuildSuccessfulMessage ( ) : string Get the message to return when a build succeeded.
printMessage ( string $message, OutputStream $stream, integer $priority ) : void Prints a message to console.

Method Details

__construct() public méthode

Construct a new default logger.
public __construct ( )

buildFinished() public méthode

@param object The BuildEvent
See also: BuildEvent::getException()
public buildFinished ( BuildEvent $event )
$event BuildEvent

buildStarted() public méthode

@param object The BuildEvent
public buildStarted ( BuildEvent $event )
$event BuildEvent

formatTime() public static méthode

@param integer The time stamp
public static formatTime ( $micros )

getBuildFailedMessage() protected méthode

Get the message to return when a build failed.
protected getBuildFailedMessage ( ) : string
Résultat string The classic "BUILD FAILED"

getBuildSuccessfulMessage() protected méthode

Get the message to return when a build succeeded.
protected getBuildSuccessfulMessage ( ) : string
Résultat string The classic "BUILD FINISHED"

messageLogged() public méthode

@param object The BuildEvent
public messageLogged ( BuildEvent $event )
$event BuildEvent

printMessage() protected méthode

Prints a message to console.
protected printMessage ( string $message, OutputStream $stream, integer $priority ) : void
$message string The message to print. Should not be null.
$stream OutputStream The stream to use for message printing.
$priority integer The priority of the message. (Ignored in this implementation.)
Résultat void

setErrorStream() public méthode

Sets the error stream.
public setErrorStream ( OutputStream $err )
$err OutputStream

setMessageOutputLevel() public méthode

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.
public setMessageOutputLevel ( integer $level )
$level integer The logging level for the logger.

setOutputStream() public méthode

Sets the output stream.
public setOutputStream ( OutputStream $output )
$output OutputStream

targetFinished() public méthode

@param object The BuildEvent
See also: BuildEvent::getException()
public targetFinished ( BuildEvent $event )
$event BuildEvent

targetStarted() public méthode

@param object The BuildEvent
public targetStarted ( BuildEvent $event )
$event BuildEvent

taskFinished() public méthode

@param object The BuildEvent
public taskFinished ( BuildEvent $event )
$event BuildEvent

taskStarted() public méthode

@param object The BuildEvent
public taskStarted ( BuildEvent $event )
$event BuildEvent

Property Details

$err protected_oe property

Stream to use for error output.
protected $err

$msgOutputLevel protected_oe property

@var int
protected int $msgOutputLevel
Résultat integer

$out protected_oe property

Stream to use for standard output.
protected $out

$startTime protected_oe property

@var int
protected int $startTime
Résultat integer