Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-12-03 10:33:37 +0000
committerTobias Schwarz2013-12-03 10:33:37 +0000
commitd3e46ee479464c757ffcf74673c30133a4d1b9b5 (patch)
treead91730335145c42349d4a8cdac99b9dc02b0eba
parentdcc6d4e838f60ddf07b0fcf9af672f19a4116819 (diff)
downloadorg.eclipse.tcf-d3e46ee479464c757ffcf74673c30133a4d1b9b5.tar.gz
org.eclipse.tcf-d3e46ee479464c757ffcf74673c30133a4d1b9b5.tar.xz
org.eclipse.tcf-d3e46ee479464c757ffcf74673c30133a4d1b9b5.zip
Target Explorer: enhance error reporting and logs
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepExecutor.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/nls/Messages.properties3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.log.core/src/org/eclipse/tcf/te/tcf/log/core/internal/listener/ChannelTraceListenerManager.java1
3 files changed, 10 insertions, 2 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepExecutor.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepExecutor.java
index 63fda4d9d..2af02ea81 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepExecutor.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepExecutor.java
@@ -9,6 +9,8 @@
*******************************************************************************/
package org.eclipse.tcf.te.runtime.stepper.extensions;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
import java.util.Date;
import org.eclipse.core.runtime.Assert;
@@ -63,6 +65,8 @@ public class StepExecutor implements IStepExecutor {
private final IStepper stepper;
+ public final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //$NON-NLS-1$
+
/**
* Constructor.
*/
@@ -240,7 +244,9 @@ public class StepExecutor implements IStepExecutor {
// In debug mode, there is even more information to add
if (Platform.inDebugMode()) {
- formattedMessage += NLS.bind(Messages.StepExecutor_stepFailed_debugInfo, id.toString());
+ String date = DATE_FORMAT.format(new Date(System.currentTimeMillis()));
+
+ formattedMessage += NLS.bind(Messages.StepExecutor_stepFailed_debugInfo, id.toString().replaceAll("/>", "/>\\n\\t"), date); //$NON-NLS-1$ //$NON-NLS-2$
}
return formattedMessage;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/nls/Messages.properties
index 3dd227558..b7cbf50cd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/nls/Messages.properties
@@ -47,5 +47,6 @@ Context:\t{3}
StepExecutor_error_stepFailed={0} finished with this error:\n\n{1}\n\n\
Step:\t{2}\n\
Context:\t{3}
-StepExecutor_stepFailed_debugInfo=\nDebug info:\n{0}
+StepExecutor_stepFailed_debugInfo=\nDebug info:\n{0}\n\
+Timestamp:\t{1}
StepExecutor_warning_rollbackTimeout=Step rollback was aborted due to timeout.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.log.core/src/org/eclipse/tcf/te/tcf/log/core/internal/listener/ChannelTraceListenerManager.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.log.core/src/org/eclipse/tcf/te/tcf/log/core/internal/listener/ChannelTraceListenerManager.java
index 489af348d..2080be065 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.log.core/src/org/eclipse/tcf/te/tcf/log/core/internal/listener/ChannelTraceListenerManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.log.core/src/org/eclipse/tcf/te/tcf/log/core/internal/listener/ChannelTraceListenerManager.java
@@ -114,6 +114,7 @@ public class ChannelTraceListenerManager {
FileWriter writer = LogManager.getInstance().getWriter(channel);
if (writer != null) {
try {
+ writer.write("\n\n\n"); //$NON-NLS-1$
writer.write(message);
writer.write("\n"); //$NON-NLS-1$
writer.flush();

Back to the top