org.apache.tools.ant.listener

Class CommonsLoggingListener

Implemented Interfaces:
BuildListener, EventListener, BuildListener, BuildLogger

public class CommonsLoggingListener
extends java.lang.Object
implements BuildListener, BuildLogger

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.

Since:
Ant 1.5

Constructor Summary

CommonsLoggingListener()
Construct the listener and make sure that a LogFactory can be obtained.

Method Summary

void
buildFinished(BuildEvent event)
void
buildStarted(BuildEvent event)
void
messageLogged(BuildEvent event)
void
setEmacsMode(boolean emacsMode)
void
setErrorPrintStream(PrintStream err)
void
setMessageOutputLevel(int level)
void
setOutputPrintStream(PrintStream output)
void
targetFinished(BuildEvent event)
void
targetStarted(BuildEvent event)
void
taskFinished(BuildEvent event)
void
taskStarted(BuildEvent event)

Constructor Details

CommonsLoggingListener

public CommonsLoggingListener()
Construct the listener and make sure that a LogFactory can be obtained.

Method Details

buildFinished

public void buildFinished(BuildEvent event)
Specified by:
buildFinished in interface BuildListener

See Also:
BuildListener.buildFinished(BuildEvent)


buildStarted

public void buildStarted(BuildEvent event)
Specified by:
buildStarted in interface BuildListener

See Also:
BuildListener.buildStarted(BuildEvent)


messageLogged

public void messageLogged(BuildEvent event)
Specified by:
messageLogged in interface BuildListener

See Also:
BuildListener.messageLogged(BuildEvent)


setEmacsMode

public void setEmacsMode(boolean emacsMode)
Specified by:
setEmacsMode in interface BuildLogger


setErrorPrintStream

public void setErrorPrintStream(PrintStream err)
Specified by:
setErrorPrintStream in interface BuildLogger


setMessageOutputLevel

public void setMessageOutputLevel(int level)
Specified by:
setMessageOutputLevel in interface BuildLogger


setOutputPrintStream

public void setOutputPrintStream(PrintStream output)
Specified by:
setOutputPrintStream in interface BuildLogger


targetFinished

public void targetFinished(BuildEvent event)
Specified by:
targetFinished in interface BuildListener

See Also:
BuildListener.targetFinished(BuildEvent)


targetStarted

public void targetStarted(BuildEvent event)
Specified by:
targetStarted in interface BuildListener

See Also:
BuildListener.targetStarted(BuildEvent)


taskFinished

public void taskFinished(BuildEvent event)
Specified by:
taskFinished in interface BuildListener

See Also:
BuildListener.taskFinished(BuildEvent)


taskStarted

public void taskStarted(BuildEvent event)
Specified by:
taskStarted in interface BuildListener

See Also:
BuildListener.taskStarted(BuildEvent)


Copyright B) 2000-2005 Apache Software Foundation. All Rights Reserved.