|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.listener.CommonsLoggingListener
public class 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.
| Field Summary | |
|---|---|
static java.lang.String |
PROJECT_LOG
name of the category under which project events are logged |
static java.lang.String |
TARGET_LOG
name of the category under which target events are logged |
| 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)
Set emacs mode. |
void |
setErrorPrintStream(java.io.PrintStream err)
Set the error print stream. |
void |
setMessageOutputLevel(int level)
Set the the output level. |
void |
setOutputPrintStream(java.io.PrintStream output)
Set the output print stream. |
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 |
| Field Detail |
|---|
public static final java.lang.String TARGET_LOG
public static final java.lang.String PROJECT_LOG
| Constructor Detail |
|---|
public CommonsLoggingListener()
| Method Detail |
|---|
public void buildStarted(BuildEvent event)
buildStarted in interface BuildListenerevent - An event with any relevant extra information.
Must not be null.public void buildFinished(BuildEvent event)
buildFinished in interface BuildListenerevent - An event with any relevant extra information.
Must not be null.BuildEvent.getException()public void targetStarted(BuildEvent event)
targetStarted in interface BuildListenerevent - An event with any relevant extra information.
Must not be null.BuildEvent.getTarget()public void targetFinished(BuildEvent event)
targetFinished in interface BuildListenerevent - An event with any relevant extra information.
Must not be null.BuildEvent.getException()public void taskStarted(BuildEvent event)
taskStarted in interface BuildListenerevent - An event with any relevant extra information.
Must not be null.BuildEvent.getTask()public void taskFinished(BuildEvent event)
taskFinished in interface BuildListenerevent - An event with any relevant extra information.
Must not be null.BuildEvent.getException()public void messageLogged(BuildEvent event)
messageLogged in interface BuildListenerevent - An event with any relevant extra information.
Must not be null.BuildEvent.getMessage(),
BuildEvent.getException(),
BuildEvent.getPriority()public void setMessageOutputLevel(int level)
setMessageOutputLevel in interface BuildLoggerlevel - ignoredpublic void setOutputPrintStream(java.io.PrintStream output)
setOutputPrintStream in interface BuildLoggeroutput - the output streampublic void setEmacsMode(boolean emacsMode)
setEmacsMode in interface BuildLoggeremacsMode - ignoredpublic void setErrorPrintStream(java.io.PrintStream err)
setErrorPrintStream in interface BuildLoggererr - the error stream
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||