Top Description Methods
org.apache.tools.ant

public Interface BuildLogger

extends BuildListener
Known Direct Implementers
org.apache.tools.ant.DefaultLogger, org.apache.tools.ant.XmlLogger, org.apache.tools.ant.taskdefs.RecorderEntry
Imports
java.io.PrintStream

Interface used by Ant to log the build output. A build logger is a build listener which has the 'right' to send output to the ant log, which is usually System.out unless redirected by the -logfile option.

Method Summary

Modifier and TypeMethod and Description
public default int

Returns:

Returns the currently set message output level. The default implementation of this method returns MSG_INFO.
getMessageOutputLevel
()

public void
setEmacsMode(boolean
true if output is to be unadorned so that emacs and other editors can parse files names, etc.
emacsMode
)

Sets this logger to produce emacs (and other editor) friendly output.

public void
setErrorPrintStream(PrintStream
The error stream for the logger. Must not be null.
err
)

Sets the output stream to which this logger is to send error messages.

public void
setMessageOutputLevel(int
the logging level for the logger.
level
)

Sets the highest level of message this logger should respond to.

public void
setOutputPrintStream(PrintStream
The output stream for the logger. Must not be null.
output
)

Sets the output stream to which this logger is to send its output.

Inherited from org.apache.tools.ant.BuildListener:
buildFinishedbuildStartedmessageLoggedtargetFinishedtargetStartedtaskFinishedtaskStarted

Method Detail

getMessageOutputLevelback to summary
public default int getMessageOutputLevel()
Returns:int

Returns the currently set message output level. The default implementation of this method returns MSG_INFO.

Since
1.10.13
setEmacsModeback to summary
public void setEmacsMode(boolean emacsMode)

Sets this logger to produce emacs (and other editor) friendly output.

Parameters
emacsMode:boolean

true if output is to be unadorned so that emacs and other editors can parse files names, etc.

setErrorPrintStreamback to summary
public void setErrorPrintStream(PrintStream err)

Sets the output stream to which this logger is to send error messages.

Parameters
err:PrintStream

The error stream for the logger. Must not be null.

setMessageOutputLevelback to summary
public void setMessageOutputLevel(int level)

Sets the highest level of message this logger should respond to. Only messages with a message level lower than or equal to the given level should be written to the log.

Constants for the message levels are in the Project class. The order of the levels, from least to most verbose, is MSG_ERR, MSG_WARN, MSG_INFO, MSG_VERBOSE, MSG_DEBUG.

Parameters
level:int

the logging level for the logger.

setOutputPrintStreamback to summary
public void setOutputPrintStream(PrintStream output)

Sets the output stream to which this logger is to send its output.

Parameters
output:PrintStream

The output stream for the logger. Must not be null.