Class NoBannerLogger
java.lang.Object
org.apache.tools.ant.DefaultLogger
org.apache.tools.ant.NoBannerLogger
- All Implemented Interfaces:
EventListener, BuildListener, BuildLogger
- Direct Known Subclasses:
SimpleBigProjectLogger
Extends DefaultLogger to strip out empty targets.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringName of the current target, if it should be displayed on the next message.Fields inherited from class DefaultLogger
emacsMode, err, LEFT_COLUMN_SIZE, lSep, msgOutputLevel, outModifier and TypeFieldDescriptionprotected booleanWhether or not to use emacs-style outputprotected PrintStreamPrintStream to write error messages tostatic final intSize of left-hand column for right-justified task name.protected static final StringDeprecated.protected intLowest level of message to write outprotected PrintStreamPrintStream to write non-error messages to -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringextractTargetName(BuildEvent event) Override point, extract the target namevoidmessageLogged(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.voidtargetFinished(BuildEvent event) Resets the current target name tonull.voidtargetStarted(BuildEvent event) Notes the name of the target so it can be logged if it generates any messages.Methods inherited from class DefaultLogger
buildFinished, buildStarted, extractProjectName, formatTime, getBuildFailedMessage, getBuildSuccessfulMessage, getMessageOutputLevel, getTimestamp, log, printMessage, setEmacsMode, setErrorPrintStream, setMessageOutputLevel, setOutputPrintStream, taskFinished, taskStartedModifier and TypeMethodDescriptionvoidbuildFinished(BuildEvent event) Prints whether the build succeeded or failed, any errors the occurred during the build, and how long the build took.voidbuildStarted(BuildEvent event) Responds to a build being started by just remembering the current time.protected StringextractProjectName(BuildEvent event) Get the project name or nullprotected static StringformatTime(long millis) Convenience method to format a specified length of time.protected StringThis is an override point: the message that indicates whether a build failed.protected StringThis is an override point: the message that indicates that a build succeeded.intprotected StringGet the current time.protected voidEmpty implementation which allows subclasses to receive the same output that is generated here.protected voidprintMessage(String message, PrintStream stream, int priority) Prints a message to a PrintStream.voidsetEmacsMode(boolean emacsMode) Sets this logger to produce emacs (and other editor) friendly output.voidSets the output stream to which this logger is to send error messages.voidsetMessageOutputLevel(int level) Sets the highest level of message this logger should respond to.voidsetOutputPrintStream(PrintStream output) Sets the output stream to which this logger is to send its output.voidtaskFinished(BuildEvent event) No-op implementation.voidtaskStarted(BuildEvent event) No-op implementation.
-
Field Details
-
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 tonullafter 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:
targetStartedin interfaceBuildListener- Overrides:
targetStartedin classDefaultLogger- Parameters:
event- A BuildEvent containing target information. Must not benull.- See Also:
-
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:
targetFinishedin interfaceBuildListener- Overrides:
targetFinishedin classDefaultLogger- Parameters:
event- Ignored in this implementation.- See Also:
-
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:
messageLoggedin interfaceBuildListener- Overrides:
messageLoggedin classDefaultLogger- Parameters:
event- A BuildEvent containing message information. Must not benull.- See Also:
-