diff options
| author | slewis | 2004-12-31 18:46:44 +0000 |
|---|---|---|
| committer | slewis | 2004-12-31 18:46:44 +0000 |
| commit | d35d61431126d8bcb5719eab661f559dc556cd81 (patch) | |
| tree | 1b7a257ea9dc44e8a764aea1a22343215d1950d8 | |
| parent | 675a536ae6e96a3eabaa597166db6e840b4403cc (diff) | |
| download | org.eclipse.ecf-d35d61431126d8bcb5719eab661f559dc556cd81.tar.gz org.eclipse.ecf-d35d61431126d8bcb5719eab661f559dc556cd81.tar.xz org.eclipse.ecf-d35d61431126d8bcb5719eab661f559dc556cd81.zip | |
Update to trace code
| -rw-r--r-- | framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/Trace.java | 11 | ||||
| -rw-r--r-- | framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Trace.java | 11 |
2 files changed, 16 insertions, 6 deletions
diff --git a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/Trace.java b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/Trace.java index a5b6fbe10..203037355 100644 --- a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/Trace.java +++ b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/Trace.java @@ -16,6 +16,8 @@ import java.util.Date; import org.eclipse.core.runtime.Platform; public class Trace { + public static final String tracePrefix = "(trace)"; + public static boolean ON = false; protected static boolean isEclipse = false; protected static String pluginName = ""; @@ -28,6 +30,7 @@ public class Trace { .getSymbolicName(); } catch (Exception e) { // No eclipse Platform available + System.out.println("Eclipse platform not available. "+Trace.class.getName()); } } @@ -60,17 +63,19 @@ public class Trace { } public void msg(String msg) { - System.err.println(name + "[" + getTimeString() + "]" + msg); + StringBuffer sb = new StringBuffer(name); + sb.append(getTimeString()).append(msg); + System.out.println(sb.toString()); } protected static String getTimeString() { Date d = new Date(); - SimpleDateFormat df = new SimpleDateFormat("MM/dd/yy;HH:mm:ss:SSS"); + SimpleDateFormat df = new SimpleDateFormat("[MM/dd/yy;HH:mm:ss:SSS]"); return df.format(d); } protected Trace(String str) { - name = str; + name = tracePrefix+str; } public static void setThreadDebugGroup(Object obj) { diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Trace.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Trace.java index e10712415..39a9fdcc4 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Trace.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Trace.java @@ -16,6 +16,8 @@ import java.util.Date; import org.eclipse.core.runtime.Platform; public class Trace { + public static final String tracePrefix = "(trace)"; + public static boolean ON = false; protected static boolean isEclipse = false; protected static String pluginName = ""; @@ -28,6 +30,7 @@ public class Trace { .getSymbolicName(); } catch (Exception e) { // No eclipse Platform available + System.out.println("Eclipse platform not available. "+Trace.class.getName()); } } @@ -60,17 +63,19 @@ public class Trace { } public void msg(String msg) { - System.err.println(name + "[" + getTimeString() + "]" + msg); + StringBuffer sb = new StringBuffer(name); + sb.append(getTimeString()).append(msg); + System.out.println(sb.toString()); } protected static String getTimeString() { Date d = new Date(); - SimpleDateFormat df = new SimpleDateFormat("MM/dd/yy;HH:mm:ss:SSS"); + SimpleDateFormat df = new SimpleDateFormat("[MM/dd/yy;HH:mm:ss:SSS]"); return df.format(d); } protected Trace(String str) { - name = str; + name = tracePrefix+str; } public static String convertStringAToString(String [] strings) { if (strings==null) return ""; |
