org.apache.tools.ant.listener
Class CommonsLoggingListener
java.lang.Object
org.apache.tools.ant.listener.CommonsLoggingListener
- BuildListener, EventListener, BuildListener, BuildLogger
public class CommonsLoggingListener
extends java.lang.Object
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.
static String | PROJECT_LOG - name of the category under which project events are logged
|
static String | TARGET_LOG - name of the category under which target events are logged
|
PROJECT_LOG
public static final String PROJECT_LOG
name of the category under which project events are logged
TARGET_LOG
public static final String TARGET_LOG
name of the category under which target events are logged
CommonsLoggingListener
public CommonsLoggingListener()
Construct the listener and make sure that a LogFactory
can be obtained.
setEmacsMode
public void setEmacsMode(boolean emacsMode)
Set emacs mode.
This is ignored.
- setEmacsMode in interface BuildLogger
setMessageOutputLevel
public void setMessageOutputLevel(int level)
Set the the output level.
This is not used, the logger config is used instead.
- setMessageOutputLevel in interface BuildLogger
setOutputPrintStream
public void setOutputPrintStream(PrintStream output)
Set the output print stream.
- setOutputPrintStream in interface BuildLogger
output
- the output stream