Package org.apache.tools.ant.listener
Class BigProjectLogger
java.lang.Object
org.apache.tools.ant.DefaultLogger
org.apache.tools.ant.NoBannerLogger
org.apache.tools.ant.listener.SimpleBigProjectLogger
org.apache.tools.ant.listener.BigProjectLogger
- All Implemented Interfaces:
EventListener,BuildListener,BuildLogger,SubBuildListener
This is a special logger that is designed to make it easier to work
with big projects, those that use imports and
subant to build complex systems.
- Since:
- Ant1.7.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringFooter string for the log.static final StringHeader string for the log.Fields inherited from class org.apache.tools.ant.NoBannerLogger
targetNameFields inherited from class org.apache.tools.ant.DefaultLogger
emacsMode, err, LEFT_COLUMN_SIZE, lSep, msgOutputLevel, out -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildFinished(BuildEvent event) Prints whether the build succeeded or failed, any errors the occurred during the build, and how long the build took.protected StringextractNameOrDefault(BuildEvent event) Get the name of an eventprotected 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.protected StringOverride point: return the footer string for the entry/exit messageprotected StringOverride point: return the header string for the entry/exit messagevoidmessageLogged(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.voidsubBuildFinished(BuildEvent event) Signals that the last target has finished.voidsubBuildStarted(BuildEvent event) Signals that a subbuild has started.voidtargetStarted(BuildEvent event) Notes the name of the target so it can be logged if it generates any messages.voidtaskStarted(BuildEvent event) No-op implementation.Methods inherited from class org.apache.tools.ant.listener.SimpleBigProjectLogger
extractTargetNameMethods inherited from class org.apache.tools.ant.NoBannerLogger
targetFinishedMethods inherited from class org.apache.tools.ant.DefaultLogger
buildStarted, extractProjectName, formatTime, getTimestamp, log, printMessage, setEmacsMode, setErrorPrintStream, setMessageOutputLevel, setOutputPrintStream, taskFinishedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.tools.ant.BuildListener
buildStarted, targetFinished, taskFinished
-
Field Details
-
HEADER
Header string for the log. "======================================================================"- See Also:
-
FOOTER
Footer string for the log. "======================================================================"- See Also:
-
-
Constructor Details
-
BigProjectLogger
public BigProjectLogger()
-
-
Method Details
-
getBuildFailedMessage
This is an override point: the message that indicates whether a build failed. Subclasses can change/enhance the message.- Overrides:
getBuildFailedMessagein classDefaultLogger- Returns:
- The classic "BUILD FAILED" plus a timestamp
-
getBuildSuccessfulMessage
This is an override point: the message that indicates that a build succeeded. Subclasses can change/enhance the message.- Overrides:
getBuildSuccessfulMessagein classDefaultLogger- Returns:
- The classic "BUILD SUCCESSFUL" plus a timestamp
-
targetStarted
Notes the name of the target so it can be logged if it generates any messages.- Specified by:
targetStartedin interfaceBuildListener- Overrides:
targetStartedin classNoBannerLogger- Parameters:
event- BuildEvent- See Also:
-
taskStarted
No-op implementation.- Specified by:
taskStartedin interfaceBuildListener- Overrides:
taskStartedin classDefaultLogger- Parameters:
event- BuildEvent- See Also:
-
buildFinished
Prints whether the build succeeded or failed, any errors the occurred during the build, and how long the build took.- Specified by:
buildFinishedin interfaceBuildListener- Overrides:
buildFinishedin classDefaultLogger- Parameters:
event- BuildEvent- 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 classNoBannerLogger- Parameters:
event- BuildEvent- See Also:
-
subBuildStarted
Signals that a subbuild has started. This event is fired before any targets have started.- Specified by:
subBuildStartedin interfaceSubBuildListener- Parameters:
event- An event with any relevant extra information. Must not benull.
-
extractNameOrDefault
Get the name of an event- Parameters:
event- the event name- Returns:
- the name or a default string
-
subBuildFinished
Signals that the last target has finished. This event will still be fired if an error occurred during the build.- Specified by:
subBuildFinishedin interfaceSubBuildListener- Parameters:
event- An event with any relevant extra information. Must not benull.- See Also:
-
getHeader
Override point: return the header string for the entry/exit message- Returns:
- the header string
-