org.apache.tools.ant.listener
Class WinColorLogger
java.lang.Object
org.apache.tools.ant.DefaultLogger
org.apache.tools.ant.listener.WinColorLogger
- All Implemented Interfaces:
- java.util.EventListener, BuildListener, BuildLogger
public class WinColorLogger
- extends DefaultLogger
Uses Widows Color Code Sequences to colorize messages
sent to the console.
If used with the -logfile option, the output file
will not be colorized.
Only works on Windowns cmd.exe.
The default colors used for differentiating
the message levels can be changed by editing the
/org/apache/tools/ant/listener/defaults.properties
file.
This file contains 5 key/value pairs:
WinColorLogger.ERROR_COLOR=4 // red
WinColorLogger.WARNING_COLOR=2;35
WinColorLogger.INFO_COLOR=2;36
WinColorLogger.VERBOSE_COLOR=2;32
WinColorLogger.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 Window Color
Codes, to the java command using -D option.
To change these colors use the following chart:
WIN COLOR LOGGER CONFIGURATION
Format for WinColorLogger.*=
Attribute;Foreground;Background
|
Method Summary |
void |
buildFinished(BuildEvent event)
Prints whether the build succeeded or failed,
any errors the occurred during the build, and
how long the build took. |
protected void |
finalize()
|
protected void |
outputSummary()
|
protected void |
printMessage(java.lang.String message,
java.io.PrintStream stream,
int priority)
Prints a message to a PrintStream. |
| Methods inherited from class org.apache.tools.ant.DefaultLogger |
buildStarted, extractProjectName, formatTime, getBuildFailedMessage, getBuildSuccessfulMessage, getTimestamp, log, messageLogged, setEmacsMode, setErrorPrintStream, setMessageOutputLevel, setOutputPrintStream, targetFinished, targetStarted, taskFinished, taskStarted |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WinColorLogger
public WinColorLogger()
finalize
protected void finalize()
throws java.lang.Exception
- Overrides:
finalize in class java.lang.Object
- Throws:
java.lang.Exception
outputSummary
protected void outputSummary()
throws java.lang.Exception
- Throws:
java.lang.Exception
printMessage
protected void printMessage(java.lang.String message,
java.io.PrintStream stream,
int priority)
- Prints a message to a PrintStream..
- Overrides:
printMessage in class DefaultLogger
- Parameters:
message - The message to print.
Should not be null.stream - A PrintStream to print the message to.
Must not be null.priority - The priority of the message.
(Ignored in this implementation.)
buildFinished
public void buildFinished(BuildEvent event)
- Description copied from class:
DefaultLogger
- Prints whether the build succeeded or failed,
any errors the occurred during the build, and
how long the build took.
- Specified by:
buildFinished in interface BuildListener- Overrides:
buildFinished in class DefaultLogger
- Parameters:
event - An event with any relevant extra information.
Must not be null.- See Also:
BuildEvent.getException()