FileDocCategorySizeDatePackage
TimestampedLogger.javaAPI DocApache Ant 1.702241Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.listener

TimestampedLogger

public class TimestampedLogger extends org.apache.tools.ant.DefaultLogger
Like a normal logger, except with timed outputs

Fields Summary
private static final String
SPACER
what appears between the old message and the new
Constructors Summary
Methods Summary
protected java.lang.StringgetBuildFailedMessage()
This is an override point: the message that indicates whether a build failed. Subclasses can change/enhance the message.

return
The classic "BUILD FAILED"



                                
       
        return super.getBuildFailedMessage() + SPACER + getTimestamp();
    
protected java.lang.StringgetBuildSuccessfulMessage()
This is an override point: the message that indicates that a build succeeded. Subclasses can change/enhance the message.

return
The classic "BUILD SUCCESSFUL"

        return super.getBuildSuccessfulMessage() + SPACER + getTimestamp();
    
protected java.lang.StringgetTimestamp()
Get the current time.

return
the current time as a formatted string.

        Date date = new Date(System.currentTimeMillis());
        DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
        String finishTime = formatter.format(date);
        return finishTime;