Package org.apache.tools.ant
Class NoBannerLogger
java.lang.Object
org.apache.tools.ant.DefaultLogger
org.apache.tools.ant.NoBannerLogger
- All Implemented Interfaces:
java.util.EventListener
,BuildListener
,BuildLogger
- Direct Known Subclasses:
SimpleBigProjectLogger
public class NoBannerLogger extends DefaultLogger
Extends DefaultLogger to strip out empty targets.
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.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
emacsMode, err, LEFT_COLUMN_SIZE, lSep, msgOutputLevel, out
-
Constructor Summary
Constructors Constructor Description NoBannerLogger()
Sole constructor. -
Method Summary
Modifier and Type Method Description protected java.lang.String
extractTargetName(BuildEvent event)
Override point, extract the target namevoid
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 tonull
.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, extractProjectName, formatTime, getBuildFailedMessage, getBuildSuccessfulMessage, getTimestamp, log, printMessage, setEmacsMode, setErrorPrintStream, setMessageOutputLevel, setOutputPrintStream, taskFinished, taskStarted
-
Field Details
-
targetName
protected java.lang.String targetNameName of the current target, if it should be displayed on the next message. This is set when a target starts building, and reset tonull
after the first message for the target is logged.
-
-
Constructor Details
-
NoBannerLogger
public NoBannerLogger()Sole constructor.
-
-
Method Details
-
targetStarted
Notes the name of the target so it can be logged if it generates any messages.- Specified by:
targetStarted
in interfaceBuildListener
- Overrides:
targetStarted
in classDefaultLogger
- Parameters:
event
- A BuildEvent containing target information. Must not benull
.- See Also:
BuildEvent.getTarget()
-
extractTargetName
Override point, extract the target name- Parameters:
event
- the event to work on- Returns:
- the target name to print
- Since:
- Ant1.7.1
-
targetFinished
Resets the current target name tonull
.- Specified by:
targetFinished
in interfaceBuildListener
- Overrides:
targetFinished
in classDefaultLogger
- Parameters:
event
- Ignored in this implementation.- See Also:
BuildEvent.getException()
-
messageLogged
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 interfaceBuildListener
- Overrides:
messageLogged
in classDefaultLogger
- Parameters:
event
- A BuildEvent containing message information. Must not benull
.- See Also:
BuildEvent.getMessage()
,BuildEvent.getException()
,BuildEvent.getPriority()
-