|
|
Re: Where do all those "trace" check boxes come from when debugging a plugin? [message #548142 is a reply to message #548100] |
Tue, 20 July 2010 18:48 |
|
Okey doke. Google code search is ever so helpful in tracking down examples.
Want to see all the eclipse code they can find?
http://www.google.com/codesearch?q=lang%3Ajava+package%3Aorg .eclipse&hl=en&btnG=Search+Code
One of the the internal.policy ".options" file looks like this:
# Debugging options for the org.eclipse.ui.ide plugin.
# Turn on debugging for the org.eclipse.ui plugin.
org.eclipse.ui.ide/debug=false
# Show a dialog with details button when an internal error occur.
org.eclipse.ui.ide/debug/internalerror/openDialog=false
# Verbose information when IDE performs explicit garbage collection
org.eclipse.ui.ide/debug/gc=false
# Print debug information when workspace undo monitor purges the undo history
org.eclipse.ui.ide/debug/undomonitor=false
# Print debug information for core exceptions when accessing markers
org.eclipse.ui.ide/debug/markers=false
And here's how you'd use it in code:
static {
if (getDebugOption("/debug")) { //$NON-NLS-1$
DEBUG_OPEN_ERROR_DIALOG = getDebugOption("/debug/internalerror/openDialog"); //$NON-NLS-1$
DEBUG_GC = getDebugOption("/debug/gc"); //$NON-NLS-1$
DEBUG_UNDOMONITOR = getDebugOption("/debug/undomonitor"); //$NON-NLS-1$
DEBUG_CORE_EXCEPTIONS = getDebugOption("/debug/coreExceptions"); //$NON-NLS-1$
}
}
private static boolean getDebugOption(String option) {
return "true".equalsIgnoreCase(Platform.getDebugOption(IDEWorkbenchPlugin.IDE_WORKBENCH + option)); //$NON-NLS-1$
}
The DEBUG_* variables are all public static booleans IIRC... closed the tab.
Oops. The "debug/markers" trace flag isn't checked.
EDIT: I went to whip up a little wiki page on the subject... turns out someone beat me to it:
http://wiki.eclipse.org/FAQ_How_do_I_use_the_platform_debug_ tracing_facility%3F
--Mark Storer
Senior Software Engineer
Autonomy Cardiff
import legalese.disclaimer;
Disclaimer<Cardiff> disCard = null;
Google Code Search
[Updated on: Tue, 20 July 2010 18:52] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03462 seconds