forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r125560 - /forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/AntBuildListener.java
Date Tue, 18 Jan 2005 23:11:31 GMT
Author: rgardler
Date: Tue Jan 18 15:03:05 2005
New Revision: 125560

URL: http://svn.apache.org/viewcvs?view=rev&rev=125560
Log:
improve logging messages
Modified:
   forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/AntBuildListener.java

Modified: forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/AntBuildListener.java
Url: http://svn.apache.org/viewcvs/forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/AntBuildListener.java?view=diff&rev=125560&p1=forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/AntBuildListener.java&r1=125559&p2=forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/AntBuildListener.java&r2=125560
==============================================================================
--- forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/AntBuildListener.java	(original)
+++ forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/AntBuildListener.java	Tue
Jan 18 15:03:05 2005
@@ -1,9 +1,15 @@
 package org.apache.forrest.eclipse.job;
 
-import org.apache.log4j.Logger;
+import java.net.URL;
 
+import org.apache.forrest.eclipse.ForrestPlugin;
+import org.apache.log4j.Logger;
+import org.apache.log4j.xml.DOMConfigurator;
 import org.apache.tools.ant.BuildEvent;
 import org.apache.tools.ant.BuildListener;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.osgi.framework.Bundle;
 
 /**
  * A listener for Ant Builds, all events are logged to the standard logger.
@@ -20,55 +26,59 @@
 	 */
 	public AntBuildListener() {
 		super();
-		// TODO Auto-generated constructor stub
+		Bundle bundle = Platform.getBundle(ForrestPlugin.ID);
+		URL log4jConf = Platform.find(bundle, new Path("conf/log4j.xml"));
+		DOMConfigurator.configure(log4jConf);
 	}
 
 	/* (non-Javadoc)
 	 * @see org.apache.tools.ant.BuildListener#buildFinished(org.apache.tools.ant.BuildEvent)
 	 */
 	public void buildFinished(BuildEvent event) {
-		logger.debug("Ant Finished Build: " + event.getMessage());
+		logger.info("Ant Finished Build: " + event.getMessage());
 	}
 	
 	/* (non-Javadoc)
 	 * @see org.apache.tools.ant.BuildListener#buildStarted(org.apache.tools.ant.BuildEvent)
 	 */
 	public void buildStarted(BuildEvent event) {
-		logger.debug("Ant Started Build: " + event.getMessage());
+		logger.info("Ant Started Build: " + event.getMessage());
 	}
 	
 	/* (non-Javadoc)
 	 * @see org.apache.tools.ant.BuildListener#messageLogged(org.apache.tools.ant.BuildEvent)
 	 */
 	public void messageLogged(BuildEvent event) {
-		logger.debug("Anr Message: " + event.getMessage());
+		logger.info("Ant Message: " + event.getMessage());
 	}
 	
 	/* (non-Javadoc)
 	 * @see org.apache.tools.ant.BuildListener#targetFinished(org.apache.tools.ant.BuildEvent)
 	 */
 	public void targetFinished(BuildEvent event) {
-		logger.debug("Ant Target Finished: " + event.getMessage());
+		logger.info("Ant Target Finished: " + 
+				event.getTarget().getName());
 	}
 	/* (non-Javadoc)
 	 * @see org.apache.tools.ant.BuildListener#targetStarted(org.apache.tools.ant.BuildEvent)
 	 */
 	public void targetStarted(BuildEvent event) {
-		logger.debug("Ant Target Started: " + event.getMessage());
+		logger.info("Ant Target Started: " + 
+				event.getTarget().getName());
 	}
 	
 	/* (non-Javadoc)
 	 * @see org.apache.tools.ant.BuildListener#taskFinished(org.apache.tools.ant.BuildEvent)
 	 */
 	public void taskFinished(BuildEvent event) {
-		logger.debug("Ant Task Finished: " + event.getMessage());
+		logger.debug("Ant Task Finished: " + event.getTask().getTaskName());
 	}
 	
 	/* (non-Javadoc)
 	 * @see org.apache.tools.ant.BuildListener#taskStarted(org.apache.tools.ant.BuildEvent)
 	 */
 	public void taskStarted(BuildEvent event) {
-		logger.debug("Ant Task Started: " + event.getMessage());
+		logger.debug("Ant Task Started: " + event.getTask().getTaskName());
 
 	}
 }

Mime
View raw message