platform35/org.eclipse.core.resources/src/org/eclipse/core/resources/ResourcesPlugin.java
changeset 41 16fbfdc9921a
parent 40 eb3c938c7fef
--- a/platform35/org.eclipse.core.resources/src/org/eclipse/core/resources/ResourcesPlugin.java	Thu Jul 30 11:56:23 2009 -0500
+++ b/platform35/org.eclipse.core.resources/src/org/eclipse/core/resources/ResourcesPlugin.java	Thu Jul 30 12:03:02 2009 -0500
@@ -17,6 +17,8 @@
 import org.eclipse.core.runtime.jobs.Job;
 import org.osgi.framework.*;
 
+import java.util.logging.Level;
+
 /**
  * The plug-in runtime class for the Resources plug-in.  This is
  * the starting point for all workspace and resource manipulation.
@@ -28,6 +30,7 @@
  * @noinstantiate This class is not intended to be instantiated by clients.
  */
 public final class ResourcesPlugin extends Plugin {
+
 	/**
 	 * Unique identifier constant (value <code>"org.eclipse.core.resources"</code>)
 	 * for the standard Resources plug-in.
@@ -152,6 +155,10 @@
 	 */
 	public static final String PREF_ENCODING = "encoding"; //$NON-NLS-1$
 
+	
+	private static final String REFRESH_LOG_ID = ".refresh.log";
+	private DiagnosticLog refreshLog;
+	
 	/** 
 	 * Common prefix for workspace preference names.
 	 * @since 2.1 
@@ -279,6 +286,20 @@
 	public ResourcesPlugin() {
 		plugin = this;
 	}
+	
+	public static void writeRefreshLog(String s) {
+		if (!plugin.getPluginPreferences().getBoolean(PI_RESOURCES + REFRESH_LOG_ID))
+			return;
+		
+		if (plugin.refreshLog == null) {
+			IPath path = getWorkspace().getRoot().getLocation().append("refresh.log");
+			plugin.refreshLog = new DiagnosticLog("refresh.log", PI_RESOURCES + REFRESH_LOG_ID, path.toOSString());
+			plugin.refreshLog.getLogger().setLevel(Level.INFO);
+		}
+
+		plugin.refreshLog.getLogger().info(s);
+		System.out.println(s);
+	}
 
 	/**
 	 * Constructs a brand new workspace structure at the location in the local file system