Fix for bugs 16429 and 16430.
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/PlatformLogWriter.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/PlatformLogWriter.java
index 4f1f7dc..3a347cb 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/PlatformLogWriter.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/PlatformLogWriter.java
@@ -11,6 +11,7 @@
package org.eclipse.core.internal.runtime;
import java.io.*;
+import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.eclipse.core.boot.BootLoader;
@@ -107,7 +108,10 @@
protected void writeHeader() throws IOException {
write(SESSION);
writeSpace();
- for (int i=SESSION.length(); i<78; i++) {
+ String date = getDate();
+ write(date);
+ writeSpace();
+ for (int i=SESSION.length()+date.length(); i<78; i++) {
write("-");//$NON-NLS-1$
}
writeln();
@@ -148,6 +152,17 @@
}
}
+protected String getDate() {
+ try {
+ DateFormat formatter = new SimpleDateFormat("MMM dd, yyyy kk:mm:ss.SS"); //$NON-NLS-1$
+ return formatter.format(new Date());
+ } catch (Exception e) {
+ // If there were problems writing out the date, ignore and
+ // continue since that shouldn't stop us from losing the rest
+ // of the information
+ }
+ return Long.toString(System.currentTimeMillis());
+}
protected Writer logForStream(OutputStream output) {
try {
return new BufferedWriter(new OutputStreamWriter(output, "UTF-8"));//$NON-NLS-1$
@@ -217,13 +232,7 @@
writeSpace();
write(Integer.toString(status.getCode()));
writeSpace();
- try {
- write(new SimpleDateFormat().format(new Date()));
- } catch (Exception e) {
- // If there were problems writing out the date, ignore and
- // continue since that shouldn't stop us from losing the rest
- // of the information
- }
+ write(getDate());
writeln();
write(MESSAGE);