public class Tracer
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static int |
callStackEntries
The max number of call stack entries to store in the trace point.
|
private static boolean |
enabled
Enabled flag.
|
private static CentralLogger |
LOG
Logger.
|
private static java.lang.String |
SEP
Platform-specific line separator.
|
private static long |
startNanoTime
System.nanoTime() at program startup.
|
private static java.util.concurrent.ConcurrentLinkedQueue<TracePoint> |
traceEntries
All the trace point entries.
|
| Constructor and Description |
|---|
Tracer() |
| Modifier and Type | Method and Description |
|---|---|
static void |
disable()
Disables tracing.
|
static void |
enable()
Enables tracing.
|
static boolean |
enabled()
Returns
true if tracing is enabled. |
private static java.lang.String |
formatTrace(java.lang.Object msg,
java.lang.Object... args)
Formats the input message and arguments for trace output.
|
static java.lang.String |
getStackTrace(int entries)
Returns a string representing the current call stack.
|
private static java.lang.String |
getStackTraceImpl(int entries,
int startAtIndex)
Returns a string representing the current call stack.
|
static void |
trace(java.lang.Object msg,
java.lang.Object... args)
The method formats
msg and args using
String.format(String, Object...) and outputs the result together with nano
time to the system error stream. |
static void |
trace(java.lang.String msg,
java.lang.Integer windowId,
java.lang.Double x1,
java.lang.Double y1,
java.lang.Double x2,
java.lang.Double y2,
java.lang.Object any1)
Creates a trace point and stores it in the internal list.
|
static void |
trace(java.lang.String msg,
java.lang.Integer windowId,
java.lang.Double x1,
java.lang.Double y1,
java.lang.Double x2,
java.lang.Double y2,
java.lang.Object any1,
java.lang.Object any2)
Creates a trace point and stores it in the internal list.
|
static void |
trace(java.lang.String msg,
java.lang.Integer windowId,
java.lang.Double x1,
java.lang.Double y1,
java.lang.Double x2,
java.lang.Double y2,
java.lang.Object any1,
java.lang.Object any2,
java.lang.Object any3)
Creates a trace point and stores it in the internal list.
|
static void |
trace(java.lang.String msg,
java.lang.Integer windowId,
java.lang.Integer x1,
java.lang.Integer y1,
java.lang.Integer x2,
java.lang.Integer y2,
java.lang.Object any1)
Creates a trace point and stores it in the internal list.
|
static void |
trace(java.lang.String msg,
java.lang.Integer windowId,
java.lang.Integer x1,
java.lang.Integer y1,
java.lang.Integer x2,
java.lang.Integer y2,
java.lang.Object any1,
java.lang.Object any2)
Creates a trace point and stores it in the internal list.
|
static void |
trace(java.lang.String msg,
java.lang.Integer windowId,
java.lang.Integer x1,
java.lang.Integer y1,
java.lang.Integer x2,
java.lang.Integer y2,
java.lang.Object any1,
java.lang.Object any2,
java.lang.Object any3)
Creates a trace point and stores it in the internal list.
|
private static void |
traceImpl(java.lang.String msg,
java.lang.Integer windowId,
java.lang.Double x1,
java.lang.Double y1,
java.lang.Double x2,
java.lang.Double y2,
java.lang.Object any1,
java.lang.Object any2,
java.lang.Object any3)
Creates a trace point and stores it in the internal list.
|
static void |
traces(int callstackEntries,
java.lang.Object msg,
java.lang.Object... args)
The method formats
msg and args using
String.format(String, Object...) and outputs the result together with nano
time to the system error stream. |
private static final java.lang.String SEP
private static final CentralLogger LOG
private static final long startNanoTime
private static boolean enabled
private static int callStackEntries
private static java.util.concurrent.ConcurrentLinkedQueue<TracePoint> traceEntries
public static boolean enabled()
true if tracing is enabled.public static void enable()
public static void disable()
public static void trace(java.lang.String msg,
java.lang.Integer windowId,
java.lang.Integer x1,
java.lang.Integer y1,
java.lang.Integer x2,
java.lang.Integer y2,
java.lang.Object any1)
msg - An optional message to store in the trace point.
// TODO: these are too specificwindowId - x1 - y1 - x2 - y2 - any1 - Optional reference to store with the trace point.public static void trace(java.lang.String msg,
java.lang.Integer windowId,
java.lang.Integer x1,
java.lang.Integer y1,
java.lang.Integer x2,
java.lang.Integer y2,
java.lang.Object any1,
java.lang.Object any2)
msg - An optional message to store in the trace point.
// TODO: these are too specificwindowId - x1 - y1 - x2 - y2 - any1 - Optional reference to store with the trace point.any2 - Optional reference to store with the trace point.public static void trace(java.lang.String msg,
java.lang.Integer windowId,
java.lang.Integer x1,
java.lang.Integer y1,
java.lang.Integer x2,
java.lang.Integer y2,
java.lang.Object any1,
java.lang.Object any2,
java.lang.Object any3)
msg - An optional message to store in the trace point.
// TODO: these are too specificwindowId - x1 - y1 - x2 - y2 - any1 - Optional reference to store with the trace point.any2 - Optional reference to store with the trace point.any3 - Optional reference to store with the trace point.public static void trace(java.lang.String msg,
java.lang.Integer windowId,
java.lang.Double x1,
java.lang.Double y1,
java.lang.Double x2,
java.lang.Double y2,
java.lang.Object any1)
msg - An optional message to store in the trace point.
// TODO: these are too specificwindowId - x1 - y1 - x2 - y2 - any1 - Optional reference to store with the trace point.public static void trace(java.lang.String msg,
java.lang.Integer windowId,
java.lang.Double x1,
java.lang.Double y1,
java.lang.Double x2,
java.lang.Double y2,
java.lang.Object any1,
java.lang.Object any2)
msg - An optional message to store in the trace point.
// TODO: these are too specificwindowId - x1 - y1 - x2 - y2 - any1 - Optional reference to store with the trace point.any2 - Optional reference to store with the trace point.public static void trace(java.lang.String msg,
java.lang.Integer windowId,
java.lang.Double x1,
java.lang.Double y1,
java.lang.Double x2,
java.lang.Double y2,
java.lang.Object any1,
java.lang.Object any2,
java.lang.Object any3)
msg - An optional message to store in the trace point.
// TODO: these are too specificwindowId - x1 - y1 - x2 - y2 - any1 - Optional reference to store with the trace point.any2 - Optional reference to store with the trace point.any3 - Optional reference to store with the trace point.private static void traceImpl(java.lang.String msg,
java.lang.Integer windowId,
java.lang.Double x1,
java.lang.Double y1,
java.lang.Double x2,
java.lang.Double y2,
java.lang.Object any1,
java.lang.Object any2,
java.lang.Object any3)
msg - An optional message to store in the trace point.
// TODO: these are too specificwindowId - x1 - y1 - x2 - y2 - any1 - Optional reference to store with the trace point.any2 - Optional reference to store with the trace point.any3 - Optional reference to store with the trace point.public static void trace(java.lang.Object msg,
java.lang.Object... args)
msg and args using
String.format(String, Object...) and outputs the result together with nano
time to the system error stream.msg - The message to output.args - The arguments to format the message with.public static void traces(int callstackEntries,
java.lang.Object msg,
java.lang.Object... args)
msg and args using
String.format(String, Object...) and outputs the result together with nano
time to the system error stream. The method also outputs the current call stack with the
callstackEntries number of entries.msg - The message to output.args - The arguments to format the message with.public static java.lang.String getStackTrace(int entries)
entries - Number of stack entries to dump.private static java.lang.String formatTrace(java.lang.Object msg,
java.lang.Object... args)
msg - The message to output.args - The arguments to format the message with.private static java.lang.String getStackTraceImpl(int entries,
int startAtIndex)
entries - Number of stack entries to return, use negative number to get all.startAtIndex - The index which will become the top of the resulting stack.