public interface DebugTrace
DebugOptions class. The trace implementation
will automatically insert additional contextual information such as the bundle, class,
and method performing the tracing.
Trace statements may be written to a file, or onto standard output, depending on
how the DebugOptions is configured (See DebugOptions.setFile(java.io.File)).
All methods on this class have an optional option argument.
When specified, this argument will cause the tracing to be conditional on the value
of DebugOptions.getBooleanOption(String, boolean), where the bundle's
symbolic name will automatically be prepended to the provided option string. For example,
if your bundle symbolic name is "com.acme.bundle", and you provide an option argument
of "/debug/parser", the trace will only be printed if the option "com.acme.bundle/debug/parser"
has a value of "true".
Note that the pipe character ("|") is reserved for internal use. If this character happens to occur in any of the thread name, the option, the message or an Exception message, it will be escaped to the corresponding HTML representation ("|").
| Modifier and Type | Method and Description |
|---|---|
void |
trace(String option,
String message)
Traces a message for the specified option.
|
void |
trace(String option,
String message,
Throwable error)
Traces a message and exception for the specified option.
|
void |
traceDumpStack(String option)
Adds a trace message showing a thread stack dump for the current class and
method being executed for the specified option.
|
void |
traceEntry(String option)
Add a trace message level stating that a method is being executed for the specified option.
|
void |
traceEntry(String option,
Object methodArgument)
Add a trace message level stating that a method with the specified argument
values is being executed for the specified option.
|
void |
traceEntry(String option,
Object[] methodArguments)
Add a trace message level stating that a method with the specified arguments
values is being executed for the specified option.
|
void |
traceExit(String option)
Add a trace message level stating that a method has completed execution for the specified option.
|
void |
traceExit(String option,
Object result)
Add a trace message level stating that a method with the specified result value
has completed execution for the specified option.
|
void trace(String option, String message)
option - The name of the boolean option that will control whether the
trace statement is printed (e.g., "/debug/myComponent"), or nullmessage - The trace message to displayvoid trace(String option, String message, Throwable error)
option - The name of the boolean option that will control whether the
trace statement is printed (e.g., "/debug/myComponent"), or nullmessage - The trace message to displayerror - The exception to tracevoid traceDumpStack(String option)
option - The name of the boolean option that will control whether the
trace statement is printed (e.g., "/debug/myComponent"), or nullvoid traceEntry(String option)
option - The name of the boolean option that will control whether the
trace statement is printed (e.g., "/debug/myComponent"), or nullvoid traceEntry(String option, Object methodArgument)
String.valueOf(Object)
on the methodArgument will be written to the trace file.option - The name of the boolean option that will control whether the
trace statement is printed (e.g., "/debug/myComponent"), or nullmethodArgument - The single argument for the method being executedvoid traceEntry(String option, Object[] methodArguments)
String.valueOf(Object)
on each argument will be written to the trace file.option - The name of the boolean option that will control whether the
trace statement is printed (e.g., "/debug/myComponent"), or nullmethodArguments - A list of object arguments for the method being executedvoid traceExit(String option)
option - The name of the boolean option that will control whether the
trace statement is printed (e.g., "/debug/myComponent"), or nullvoid traceExit(String option, Object result)
String.valueOf(Object)
on the result object will be written to the trace file.option - The name of the boolean option that will control whether the
trace statement is printed (e.g., "/debug/myComponent"), or nullresult - The result being returned from the method that was executed
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.