phing-listener

# Class: DefaultLogger Source Location: /listener/DefaultLogger.php
### Class Overview
Writes a build event to the console. #### Author(s): Andreas Aderhold <andi@binarycloud.com> #### Version: $Revision: 552 $ $Date: 2009-08-29 14:18:13 +0200 (Sat, 29 Aug 2009) $ #### Copyright: � 2001,2002 THYRELL. All rights reserved Implements interfaces: StreamRequiredBuildLogger | ### Variables $err $msgOutputLevel $out $startTime | ### Constants LEFT_COLUMN_SIZE | ### Methods __construct buildFinished buildStarted formatTime getBuildFailedMessage getBuildSuccessfulMessage messageLogged printMessage setErrorStream setMessageOutputLevel setOutputStream targetFinished targetStarted taskFinished taskStarted
### Child classes: NoBannerLogger Extends DefaultLogger to strip out empty targets. AnsiColorLogger Uses ANSI Color Code Sequences to colorize messages sent to the console.
### Class Details [line 37] Writes a build event to the console. Currently, it only writes which targets are being executed, and any messages that get logged. #### Tags:
author: | Andreas Aderhold <andi@binarycloud.com>
version: | $Revision: 552 $ $Date: 2009-08-29 14:18:13 +0200 (Sat, 29 Aug 2009) $
copyright: | � 2001,2002 THYRELL. All rights reserved
see: | BuildEvent
[ Top ] ### Class Variables #### $err = [line 66] #### Tags:
var: | Stream to use for error output.
access: | protected
Type: | OutputStream
[ Top ] #### $msgOutputLevel = Project::MSG_ERR [line 50] The message output level that should be used. The default is Project::MSG_VERBOSE . #### Tags:
access: | protected
Type: | int
[ Top ] #### $out = [line 61] #### Tags:
var: | Stream to use for standard output.
access: | protected
Type: | OutputStream
[ Top ] #### $startTime = [line 56] Time that the build started #### Tags:
access: | protected
Type: | int
[ Top ] ### Class Methods ### static method formatTime [line 254]
`static void formatTime( integer $micros)`
Formats a time micro integer to human readable format. #### Tags:
access: | public
#### Parameters:
integer | $micros | The time stamp
[ Top ] ### constructor __construct [line 71]
`DefaultLogger __construct( )`
Construct a new default logger. #### Tags:
access: | public
Overridden in child classes as: AnsiColorLogger::__construct() Construct new AnsiColorLogger Perform initializations that cannot be done in var declarations. [ Top ] ### method buildFinished [line 140]
`void buildFinished( $event)`
Prints whether the build succeeded or failed, and any errors that occured during the build. Also outputs the total build-time. #### Tags:
see: | BuildEvent::getException()
access: | public
Implementation of: StreamRequiredBuildLogger::buildFinished #### Parameters:
object The | $event | BuildEvent
[ Top ] ### method buildStarted [line 126]
`void buildStarted( $event)`
Sets the start-time when the build started. Used for calculating the build-time. #### Tags:
access: | public
Implementation of: StreamRequiredBuildLogger::buildStarted #### Parameters:
object The | $event | BuildEvent
[ Top ] ### method getBuildFailedMessage [line 165]
`string getBuildFailedMessage( )`
Get the message to return when a build failed. #### Tags:
return: | The classic "BUILD FAILED"
access: | protected
[ Top ] ### method getBuildSuccessfulMessage [line 173]
`string getBuildSuccessfulMessage( )`
Get the message to return when a build succeeded. #### Tags:
return: | The classic "BUILD FINISHED"
access: | protected
[ Top ] ### method messageLogged [line 228]
`void messageLogged( $event)`
Print a message to the stdout. #### Tags:
see: | BuildEvent::getMessage()
access: | public
Overridden in child classes as: NoBannerLogger::messageLogged() Implementation of: StreamRequiredBuildLogger::messageLogged #### Parameters:
object The | $event | BuildEvent
[ Top ] ### method printMessage [line 276]
`void printMessage( string $message, $stream, int $priority)`
Prints a message to console. #### Tags:
access: | protected
Overridden in child classes as: AnsiColorLogger::printMessage() #### Parameters:
string | $message | The message to print. Should not be null .
resource | $stream | The stream to use for message printing.
int | $priority | The priority of the message. (Ignored in this implementation.)
[ Top ] ### method setErrorStream [line 115]
`void setErrorStream( $err)`
Sets the error stream. #### Tags:
see: | setErrorStream()
access: | public
Implementation of: StreamRequiredBuildLogger::setErrorStream #### Parameters:
OutputStream | $err |
[ Top ] ### method setMessageOutputLevel [line 97]
`void 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. #### Tags:
see: | setMessageOutputLevel()
access: | public
Implementation of: StreamRequiredBuildLogger::setMessageOutputLevel #### Parameters:
int | $level | The logging level for the logger.
[ Top ] ### method setOutputStream [line 106]
`void setOutputStream( $output)`
Sets the output stream. #### Tags:
see: | setOutputStream()
access: | public
Implementation of: StreamRequiredBuildLogger::setOutputStream #### Parameters:
OutputStream | $output |
[ Top ] ### method targetFinished [line 199]
`void targetFinished( $event)`
Fired when a target has finished. We don't need specific action on this event. So the methods are empty. #### Tags:
see: | BuildEvent::getException()
access: | public
Overridden in child classes as: NoBannerLogger::targetFinished() Implementation of: StreamRequiredBuildLogger::targetFinished #### Parameters:
object The | $event | BuildEvent
[ Top ] ### method targetStarted [line 184]
`void targetStarted( $event)`
Prints the current target name #### Tags:
see: | BuildEvent::getTarget()
access: | public
Overridden in child classes as: NoBannerLogger::targetStarted() Implementation of: StreamRequiredBuildLogger::targetStarted #### Parameters:
object The | $event | BuildEvent
[ Top ] ### method taskFinished [line 219]
`void taskFinished( $event)`
Fired when a task has finished. We don't need specific action on this event. So the methods are empty. #### Tags:
see: | BuildEvent::getException()
access: | public
Implementation of: StreamRequiredBuildLogger::taskFinished #### Parameters:
object The | $event | BuildEvent
[ Top ] ### method taskStarted [line 209]
`void taskStarted( $event)`
Fired when a task is started. We don't need specific action on this event. So the methods are empty. #### Tags:
see: | BuildEvent::getTask()
access: | public
Implementation of: StreamRequiredBuildLogger::taskStarted #### Parameters:
object The | $event | BuildEvent
[ Top ] ### Class Constants #### LEFT_COLUMN_SIZE = 12 [line 43] Size of the left column in output. The default char width is 12. [ Top ] Documentation generated on Mon, 19 Oct 2009 10:50:45 +0200 by phpDocumentor 1.4.3