FileDocCategorySizeDatePackage
NoBannerLogger.javaAPI DocApache Ant 1.702763Wed Dec 13 06:16:24 GMT 2006org.apache.tools.ant

NoBannerLogger

public class NoBannerLogger extends DefaultLogger
Extends DefaultLogger to strip out empty targets.

Fields Summary
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.
Constructors Summary
public NoBannerLogger()
Sole constructor.

    
Methods Summary
public voidmessageLogged(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.

param
event A BuildEvent containing message information. Must not be null.


        if (event.getPriority() > msgOutputLevel
            || null == event.getMessage()
            || "".equals(event.getMessage().trim())) {
                return;
        }

        if (null != targetName) {
            out.println(StringUtils.LINE_SEP + targetName + ":");
            targetName = null;
        }

        super.messageLogged(event);
    
public voidtargetFinished(BuildEvent event)
Resets the current target name to null.

param
event Ignored in this implementation.

        targetName = null;
    
public voidtargetStarted(BuildEvent event)
Notes the name of the target so it can be logged if it generates any messages.

param
event A BuildEvent containing target information. Must not be null.

        targetName = event.getTarget().getName();