Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 143916 Details for
Bug 286130
Change trace output to ensure it can be read back in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
possible solution
debugtrace.patch (text/plain), 3.61 KB, created by
Troy Bishop
on 2009-08-10 10:37:08 EDT
(
hide
)
Description:
possible solution
Filename:
MIME Type:
Creator:
Troy Bishop
Created:
2009-08-10 10:37:08 EDT
Size:
3.61 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.osgi >Index: supplement/src/org/eclipse/osgi/framework/debug/EclipseDebugTrace.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/debug/EclipseDebugTrace.java,v >retrieving revision 1.4 >diff -u -r1.4 EclipseDebugTrace.java >--- supplement/src/org/eclipse/osgi/framework/debug/EclipseDebugTrace.java 31 Jul 2009 22:06:47 -0000 1.4 >+++ supplement/src/org/eclipse/osgi/framework/debug/EclipseDebugTrace.java 10 Aug 2009 14:37:26 -0000 >@@ -40,7 +40,7 @@ > /** The version attribute written to the header of the trace file */ > private final static String TRACE_FILE_VERSION_COMMENT = "version: "; //$NON-NLS-1$ > /** The version value written to the header of the trace file */ >- private final static String TRACE_FILE_VERSION = "1.0"; //$NON-NLS-1$ >+ private final static String TRACE_FILE_VERSION = "1.1"; //$NON-NLS-1$ > /** The new session identifier to be written whenever a new session starts */ > private final static String TRACE_NEW_SESSION = "!SESSION "; //$NON-NLS-1$ > /** The date attribute written to the header of the trace file to show when this file was created */ >@@ -201,8 +201,10 @@ > } else { > messageBuffer.append(EclipseDebugTrace.NULL_VALUE); > } >- messageBuffer.append(" "); //$NON-NLS-1$ > i++; >+ if (i < methodArguments.length) { >+ messageBuffer.append(" "); //$NON-NLS-1$ >+ } > } > messageBuffer.append(")"); //$NON-NLS-1$ > } >@@ -459,6 +461,32 @@ > } > > /** >+ * Accessor to retrieve the text of a {@link Throwable} in a formatted manner so that it can be written to the >+ * trace file. >+ * >+ * @param error The {@lnk Throwable} to format >+ * @return The complete text of a {@link Throwable} as a {@link String} or null if the input error is null. >+ */ >+ private final String getFormattedThrowable(Throwable error) { >+ >+ String result = null; >+ if (error != null) { >+ PrintStream throwableStream = null; >+ try { >+ ByteArrayOutputStream throwableByteOutputStream = new ByteArrayOutputStream(); >+ throwableStream = new PrintStream(throwableByteOutputStream, false); >+ error.printStackTrace(throwableStream); >+ result = throwableByteOutputStream.toString(); >+ } finally { >+ if (throwableStream != null) { >+ throwableStream.close(); >+ } >+ } >+ } >+ return result; >+ } >+ >+ /** > * Writes header information to a new trace file > * > * @param traceWriter the trace writer >@@ -487,7 +515,9 @@ > private void writeMessage(final Writer traceWriter, final FrameworkDebugTraceEntry entry) throws IOException { > > // format the trace entry >- StringBuffer message = new StringBuffer(entry.getThreadName()); >+ StringBuffer message = new StringBuffer(EclipseDebugTrace.TRACE_ELEMENT_DELIMITER); >+ message.append(" "); //$NON-NLS-1$ >+ message.append(entry.getThreadName()); > message.append(" "); //$NON-NLS-1$ > message.append(EclipseDebugTrace.TRACE_ELEMENT_DELIMITER); > message.append(" "); //$NON-NLS-1$ >@@ -519,8 +549,10 @@ > if (entry.getThrowable() != null) { > message.append(EclipseDebugTrace.TRACE_ELEMENT_DELIMITER); > message.append(" "); //$NON-NLS-1$ >- message.append(entry.getThrowable()); >+ message.append(this.getFormattedThrowable(entry.getThrowable())); > } >+ message.append(" "); //$NON-NLS-1$ >+ message.append(EclipseDebugTrace.TRACE_ELEMENT_DELIMITER); > message.append(EclipseDebugTrace.LINE_SEPARATOR); > // write the message > if ((traceWriter != null) && (message != null)) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 286130
: 143916