org.apache.tools.ant

Class NoBannerLogger

Implemented Interfaces:
BuildListener, BuildLogger, EventListener

public class NoBannerLogger
extends DefaultLogger

Extends DefaultLogger to strip out empty targets.

Field Summary

protected String
targetName
Name of the current target, if it should be displayed on the next message.

Fields inherited from class org.apache.tools.ant.DefaultLogger

LEFT_COLUMN_SIZE, emacsMode, err, lSep, msgOutputLevel, out

Constructor Summary

NoBannerLogger()
Sole constructor.

Method Summary

void
messageLogged(BuildEvent event)
Logs a message for a target if it is of an appropriate priority, also logging the name of the target if this is the first message which needs to be logged for the target.
void
targetFinished(BuildEvent event)
Resets the current target name to null.
void
targetStarted(BuildEvent event)
Notes the name of the target so it can be logged if it generates any messages.

Methods inherited from class org.apache.tools.ant.DefaultLogger

buildFinished, buildStarted, formatTime, log, messageLogged, printMessage, setEmacsMode, setErrorPrintStream, setMessageOutputLevel, setOutputPrintStream, targetFinished, targetStarted, taskFinished, taskStarted

Field Details

targetName

protected String targetName
Name of the current target, if it should be displayed on the next message. This is set when a target starts building, and reset to null after the first message for the target is logged.

Constructor Details

NoBannerLogger

public NoBannerLogger()
Sole constructor.

Method Details

messageLogged

public void messageLogged(BuildEvent event)
Logs a message for a target if it is of an appropriate priority, also logging the name of the target if this is the first message which needs to be logged for the target.
Specified by:
messageLogged in interface BuildListener
Overrides:
messageLogged in interface DefaultLogger
Parameters:
event - A BuildEvent containing message information. Must not be null.

targetFinished

public void targetFinished(BuildEvent event)
Resets the current target name to null.
Specified by:
targetFinished in interface BuildListener
Overrides:
targetFinished in interface DefaultLogger
Parameters:
event - Ignored in this implementation.

targetStarted

public void targetStarted(BuildEvent event)
Notes the name of the target so it can be logged if it generates any messages.
Specified by:
targetStarted in interface BuildListener
Overrides:
targetStarted in interface DefaultLogger
Parameters:
event - A BuildEvent containing target information. Must not be null.

Copyright B) 2000-2006 Apache Software Foundation. All Rights Reserved.