Uses ANSI Color Code Sequences to colorize messages sent to the console.
If used with the -logfile option, the output file will contain all the necessary escape codes to display the text in colorized mode when displayed in the console using applications like cat, more, etc.
This is designed to work on terminals that support ANSI color codes. It works on XTerm, ETerm, Mindterm, etc. It also works on Win9x (with ANSI.SYS loaded.)
NOTE: It doesn't work on WinNT's COMMAND.COM even with ANSI.SYS loaded.
The default colors used for differentiating the message levels can be changed by editing the phing/listener/defaults.properties file.
This file contains 5 key/value pairs: AnsiColorLogger.ERROR_COLOR=2;31 AnsiColorLogger.WARNING_COLOR=2;35 AnsiColorLogger.INFO_COLOR=2;36 AnsiColorLogger.VERBOSE_COLOR=2;32 AnsiColorLogger.DEBUG_COLOR=2;34
Another option is to pass a system variable named ant.logger.defaults, with value set to the path of the file that contains user defined Ansi Color Codes, to the java command using -D option.
To change these colors use the following chart:
<B>ANSI COLOR LOGGER CONFIGURATION</B>
Format for AnsiColorLogger.*= Attribute;Foreground;Background
Attribute is one of the following: 0 -> Reset All Attributes (return to normal mode) 1 -> Bright (Usually turns on BOLD) 2 -> Dim 3 -> Underline 5 -> link 7 -> Reverse 8 -> Hidden
Foreground is one of the following: 30 -> Black 31 -> Red 32 -> Green 33 -> Yellow 34 -> Blue 35 -> Magenta 36 -> Cyan 37 -> White
Background is one of the following: 40 -> Black 41 -> Red 42 -> Green 43 -> Yellow 44 -> Blue 45 -> Magenta 46 -> Cyan 47 -> White
author | Hans Lellelid <hans@xmpl.org> (Phing) |
---|---|
author | Magesh Umasankar (Ant) |
package | phing.listener |
version | $Id$ |
copyright | 2001,2002 THYRELL. All rights reserved |
__construct()
buildFinished(\BuildEvent $event)
Also outputs the total build-time.
inherited_from | \DefaultLogger::buildFinished() |
---|
object
The BuildEvent @see BuildEvent::getException()
buildStarted(\BuildEvent $event)
Used for calculating the build-time.
inherited_from | \DefaultLogger::buildStarted() |
---|
object
The BuildEvent @access public
formatTime($micros)
@param integer The time stamp
access | private |
---|---|
inherited_from | \DefaultLogger::formatTime() |
setErrorStream(\OutputStream $err)
see | \global\BuildLogger#setErrorStream() |
---|---|
inherited_from | \DefaultLogger::setErrorStream() |
\OutputStream
setMessageOutputLevel(int $level)
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:
The default message level for DefaultLogger is Project::MSG_ERR.
see | \global\BuildLogger#setMessageOutputLevel() |
---|---|
inherited_from | \DefaultLogger::setMessageOutputLevel() |
int
The logging level for the logger.
setOutputStream(\OutputStream $output)
see | \global\BuildLogger#setOutputStream() |
---|---|
inherited_from | \DefaultLogger::setOutputStream() |
\OutputStream
targetFinished(\BuildEvent $event)
We don't need specific action on this event. So the methods are empty.
inherited_from | \DefaultLogger::targetFinished() |
---|
object
The BuildEvent @see BuildEvent::getException()
taskFinished(\BuildEvent $event)
We don't need specific action on this event. So the methods are empty.
inherited_from | \DefaultLogger::taskFinished() |
---|
object
The BuildEvent @access public @see BuildEvent::getException()
taskStarted(\BuildEvent $event)
We don't need specific action on this event. So the methods are empty.
inherited_from | \DefaultLogger::taskStarted() |
---|
object
The BuildEvent @access public @see BuildEvent::getTask()
getBuildFailedMessage() : string
inherited_from | \DefaultLogger::getBuildFailedMessage() |
---|
string
The classic "BUILD FAILED"getBuildSuccessfulMessage() : string
inherited_from | \DefaultLogger::getBuildSuccessfulMessage() |
---|
string
The classic "BUILD FINISHED"printMessage(string $message, \OutputStream $stream, int $priority) : void
see | \global\DefaultLogger#printMessage |
---|
string
\OutputStream
int
setColors()
$msgOutputLevel : int
The default is
Project::MSG_VERBOSE
.
inherited_from | \DefaultLogger::$$msgOutputLevel |
---|
$out : \OutputStream
inherited_from | \DefaultLogger::$$out |
---|
$startTime
@var int
inherited_from | \DefaultLogger::$$startTime |
---|
$colorsSet
$debugColor
$errColor
$infoColor
$verboseColor
$warnColor
ATTR_BLINK
ATTR_BRIGHT
ATTR_DIM
ATTR_HIDDEN
ATTR_NORMAL
ATTR_REVERSE
ATTR_UNDERLINE
BG_BLACK
BG_BLUE
BG_CYAN
BG_GREEN
BG_MAGENTA
BG_RED
BG_WHITE
BG_YELLOW
END_COLOR
FG_BLACK
FG_BLUE
FG_CYAN
FG_GREEN
FG_MAGENTA
FG_RED
FG_WHITE
FG_YELLOW
LEFT_COLUMN_SIZE : int
The default char width is 12.
inherited_from | \DefaultLogger::LEFT_COLUMN_SIZE |
---|
PREFIX
SEPARATOR
SUFFIX