public class TraceHelper
extends java.lang.Object
Constructor and Description |
---|
TraceHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
expandParameters(java.lang.Object[] args,
java.lang.StringBuilder buf)
Render the array of method arguments into a text form, optionally
using recursion to emit elements that are themselves arrays.
|
static void |
render(java.lang.Object arg,
java.lang.StringBuilder buf)
Render the the given object into a text form including handling
arrays.
|
static java.lang.Object |
trace(Invocable proxy,
java.lang.Object[] args,
java.util.logging.Logger logger,
java.lang.String caller)
Tracing worker that handles the indirect/delegated method call and
and logs when the call is made (at the FINER logging level) and logs
parameters, return values and an elapsed time in milliseconds (at
the FINEST logging level).
|
public static java.lang.Object trace(Invocable proxy, java.lang.Object[] args, java.util.logging.Logger logger, java.lang.String caller) throws java.lang.Throwable
proxy
- The object upon which the method is invoked.args
- Arguments, if any, to method
.logger
- The output target for the trace data.caller
- A text description of the calling method class and name
for insertion into each log entry.null
if
there is no return value. Note that this design does not
allow the caller to determine the difference between a
void
return and a return of a genuine
null
.java.lang.Throwable
- If the called method generates any exception or error.public static void expandParameters(java.lang.Object[] args, java.lang.StringBuilder buf)
args
- The method arguments passed to the invocation mechanism.buf
- The output buffer. Must not be null
.public static void render(java.lang.Object arg, java.lang.StringBuilder buf)
arg
- The object to render as text.buf
- The output buffer. Must not be null
.