|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.listener.CommonsLoggingListener
Jakarta Commons Logging listener. Note: do not use the SimpleLog as your logger implementation as it causes an infinite loop since it writes to System.err, which Ant traps and reroutes to the logger/listener layer. The following names are used for the log: org.apache.tools.ant.Project.PROJECT_NAME - for project events org.apache.tools.ant.Target.TARGET_NAME - for target events TASK_CLASS_NAME.TARGET_NAME - for events in individual targets. In all target and project names we replace "." and " " with "-". TODO: we should use the advanced context logging features (and expose them in c-l first :-) TODO: this is _very_ inefficient. Switching the out and tracking the logs can be optimized a lot - but may require few more changes to the core.
Constructor Summary | |
CommonsLoggingListener()
Construct the listener and make sure that a LogFactory can be obtained. |
Method Summary | |
void |
buildFinished(BuildEvent event)
Signals that the last target has finished. |
void |
buildStarted(BuildEvent event)
Signals that a build has started. |
void |
messageLogged(BuildEvent event)
Signals a message logging event. |
void |
setEmacsMode(boolean emacsMode)
Sets this logger to produce emacs (and other editor) friendly output. |
void |
setErrorPrintStream(java.io.PrintStream err)
Sets the output stream to which this logger is to send error messages. |
void |
setMessageOutputLevel(int level)
Sets the highest level of message this logger should respond to. |
void |
setOutputPrintStream(java.io.PrintStream output)
Sets the output stream to which this logger is to send its output. |
void |
targetFinished(BuildEvent event)
Signals that a target has finished. |
void |
targetStarted(BuildEvent event)
Signals that a target is starting. |
void |
taskFinished(BuildEvent event)
Signals that a task has finished. |
void |
taskStarted(BuildEvent event)
Signals that a task is starting. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CommonsLoggingListener()
Method Detail |
public void buildStarted(BuildEvent event)
BuildListener
buildStarted
in interface BuildListener
event
- An event with any relevant extra information.
Must not be null
.BuildListener.buildStarted(org.apache.tools.ant.BuildEvent)
public void buildFinished(BuildEvent event)
BuildListener
buildFinished
in interface BuildListener
event
- An event with any relevant extra information.
Must not be null
.BuildListener.buildFinished(org.apache.tools.ant.BuildEvent)
public void targetStarted(BuildEvent event)
BuildListener
targetStarted
in interface BuildListener
event
- An event with any relevant extra information.
Must not be null
.BuildListener.targetStarted(org.apache.tools.ant.BuildEvent)
public void targetFinished(BuildEvent event)
BuildListener
targetFinished
in interface BuildListener
event
- An event with any relevant extra information.
Must not be null
.BuildListener.targetFinished(org.apache.tools.ant.BuildEvent)
public void taskStarted(BuildEvent event)
BuildListener
taskStarted
in interface BuildListener
event
- An event with any relevant extra information.
Must not be null
.BuildListener.taskStarted(org.apache.tools.ant.BuildEvent)
public void taskFinished(BuildEvent event)
BuildListener
taskFinished
in interface BuildListener
event
- An event with any relevant extra information.
Must not be null
.BuildListener.taskFinished(org.apache.tools.ant.BuildEvent)
public void messageLogged(BuildEvent event)
BuildListener
messageLogged
in interface BuildListener
event
- An event with any relevant extra information.
Must not be null
.BuildListener.messageLogged(org.apache.tools.ant.BuildEvent)
public void setMessageOutputLevel(int level)
BuildLogger
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
.
setMessageOutputLevel
in interface BuildLogger
level
- the logging level for the logger.public void setOutputPrintStream(java.io.PrintStream output)
BuildLogger
setOutputPrintStream
in interface BuildLogger
output
- The output stream for the logger.
Must not be null
.public void setEmacsMode(boolean emacsMode)
BuildLogger
setEmacsMode
in interface BuildLogger
emacsMode
- true
if output is to be unadorned so that
emacs and other editors can parse files names, etc.public void setErrorPrintStream(java.io.PrintStream err)
BuildLogger
setErrorPrintStream
in interface BuildLogger
err
- The error stream for the logger.
Must not be null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |