org.apache.tools.ant.listener

Class CommonsLoggingListener

public class CommonsLoggingListener extends 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
voidbuildFinished(BuildEvent event)
voidbuildStarted(BuildEvent event)
voidmessageLogged(BuildEvent event)
voidsetEmacsMode(boolean emacsMode)
voidsetErrorPrintStream(PrintStream err)
voidsetMessageOutputLevel(int level)
voidsetOutputPrintStream(PrintStream output)
voidtargetFinished(BuildEvent event)
voidtargetStarted(BuildEvent event)
voidtaskFinished(BuildEvent event)
voidtaskStarted(BuildEvent event)

Constructor Detail

CommonsLoggingListener

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

Method Detail

buildFinished

public void buildFinished(BuildEvent event)

See Also: BuildListener

buildStarted

public void buildStarted(BuildEvent event)

See Also: BuildListener

messageLogged

public void messageLogged(BuildEvent event)

See Also: BuildListener

setEmacsMode

public void setEmacsMode(boolean emacsMode)

setErrorPrintStream

public void setErrorPrintStream(PrintStream err)

setMessageOutputLevel

public void setMessageOutputLevel(int level)

setOutputPrintStream

public void setOutputPrintStream(PrintStream output)

targetFinished

public void targetFinished(BuildEvent event)

See Also: BuildListener

targetStarted

public void targetStarted(BuildEvent event)

See Also: BuildListener

taskFinished

public void taskFinished(BuildEvent event)

See Also: BuildListener

taskStarted

public void taskStarted(BuildEvent event)

See Also: BuildListener

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