public class Debug extends Object
isEnabled()
if assertions are enabled
for the Debug
class or the system
property is "true"
when Debug
is initialized.Modifier and Type | Class and Description |
---|---|
static class |
Debug.Initialization
Class to assist with initialization of
Debug . |
static interface |
Debug.Scope
Represents a debug scope entered by
scope(Object) or
sandbox(CharSequence, DebugConfig, Object...) . |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_LOG_LEVEL |
static String |
ENABLE_METRIC_PROPERTY_NAME_PREFIX |
static String |
ENABLE_TIMER_PROPERTY_NAME_PREFIX |
static String |
ENABLE_UNSCOPED_MEM_USE_TRACKERS_PROPERTY_NAME |
static String |
ENABLE_UNSCOPED_METRICS_PROPERTY_NAME |
static String |
ENABLE_UNSCOPED_TIMERS_PROPERTY_NAME |
private static boolean |
ENABLED |
private static Set<String> |
enabledMetrics
Set of unconditionally enabled metrics.
|
private static Set<String> |
enabledMetricsSubstrings |
private static Set<String> |
enabledTimers
Set of unconditionally enabled timers.
|
private static Set<String> |
enabledTimersSubstrings |
private static ClassValue<String> |
formattedClassName
There are paths where construction of formatted class names are common and the code below is
surprisingly expensive, so compute it once and cache it.
|
private static boolean |
isUnconditionalMemUseTrackingEnabled
Specifies if all mem use trackers are unconditionally enabled.
|
private static DebugMemUseTracker |
VOID_MEM_USE_TRACKER |
private static DebugMetric |
VOID_METRIC |
private static DebugTimer |
VOID_TIMER |
Constructor and Description |
---|
Debug() |
Modifier and Type | Method and Description |
---|---|
static String |
applyFormattingFlagsAndWidth(String s,
int flags,
int width) |
static boolean |
areUnconditionalMetricsEnabled() |
static boolean |
areUnconditionalTimersEnabled() |
static Iterable<Object> |
context() |
static <T> T |
contextLookup(Class<T> clazz)
Searches the current debug scope, bottom up, for a context object that is an instance of a
given type.
|
static <T> List<T> |
contextSnapshot(Class<T> clazz) |
static Object |
convertFormatArg(Object arg) |
static DebugHistogram |
createHistogram(String name)
Creates an object for counting value frequencies.
|
private static DebugMemUseTracker |
createMemUseTracker(String format,
Object arg1,
Object arg2) |
private static DebugMetric |
createMetric(String format,
Object arg1,
Object arg2) |
private static DebugTimer |
createTimer(String format,
Object arg1,
Object arg2) |
static String |
currentScope()
Gets a string composed of the names in the current nesting of debug
scopes separated by
'.' . |
static <T> Callable<T> |
decorateDebugRoot(Callable<T> callable,
String name,
DebugConfig config) |
static Runnable |
decorateDebugRoot(Runnable runnable,
String name,
DebugConfig config) |
static <T> Callable<T> |
decorateScope(Callable<T> callable,
String name,
Object... context) |
static Runnable |
decorateScope(Runnable runnable,
String name,
Object... context) |
static DebugConfigScope |
disableIntercept()
Opens a scope in which exception interception is disabled.
|
static void |
dump(int dumpLevel,
Object object,
String msg) |
static void |
dump(int dumpLevel,
Object object,
String format,
Object arg) |
static void |
dump(int dumpLevel,
Object object,
String format,
Object[] args)
Deprecated.
|
static void |
dump(int dumpLevel,
Object object,
String format,
Object arg1,
Object arg2) |
static void |
dump(int dumpLevel,
Object object,
String format,
Object arg1,
Object arg2,
Object arg3) |
static void |
dump(Object object,
String msg) |
static void |
dump(Object object,
String format,
Object arg) |
static void |
dump(Object object,
String format,
Object[] args)
Deprecated.
|
static void |
dump(Object object,
String format,
Object arg1,
Object arg2) |
static void |
dump(Object object,
String format,
Object arg1,
Object arg2,
Object arg3) |
private static boolean |
findMatch(Set<String> haystack,
Set<String> haystackSubstrings,
String needle) |
static DebugConfig |
fixedConfig(int logLevel,
int dumpLevel,
boolean isMeterEnabled,
boolean isMemUseTrackingEnabled,
boolean isTimerEnabled,
boolean isVerifyEnabled,
Collection<DebugDumpHandler> dumpHandlers,
Collection<DebugVerifyHandler> verifyHandlers,
PrintStream output) |
static Debug.Scope |
forceLog() |
private static String |
formatDebugName(String format,
Object arg1,
Object arg2) |
static RuntimeException |
handle(Throwable exception)
Handles an exception in the context of the debug scope just exited.
|
static Indent |
indent()
Opens a new indentation level (by adding some spaces) based on the current indentation level.
|
private static boolean |
initialize() |
static boolean |
isDumpEnabled() |
static boolean |
isDumpEnabled(int dumpLevel) |
static boolean |
isDumpEnabledForMethod() |
static boolean |
isEnabled() |
static boolean |
isLogEnabled() |
static boolean |
isLogEnabled(int logLevel) |
static boolean |
isLogEnabledForMethod() |
static boolean |
isMemUseTrackingEnabled() |
static boolean |
isMeterEnabled() |
static boolean |
isTimeEnabled() |
static boolean |
isVerifyEnabled()
Determines if verification is enabled in the current debug
scope.
|
static boolean |
isVerifyEnabledForMethod()
Determines if verification is enabled in the current method, regardless of the
current debug scope.
|
static void |
log(int logLevel,
String msg)
Prints a message to the current debug scope's logging stream if logging is enabled.
|
static void |
log(int logLevel,
String format,
int arg)
Prints a message to the current debug scope's logging stream if logging is enabled.
|
static void |
log(int logLevel,
String format,
int arg1,
int arg2) |
static void |
log(int logLevel,
String format,
int arg1,
int arg2,
int arg3) |
static void |
log(int logLevel,
String format,
int arg1,
Object arg2) |
static void |
log(int logLevel,
String format,
Object arg)
Prints a message to the current debug scope's logging stream if logging is enabled.
|
static void |
log(int logLevel,
String format,
Object[] args)
Deprecated.
|
static void |
log(int logLevel,
String format,
Object arg1,
int arg2) |
static void |
log(int logLevel,
String format,
Object arg1,
Object arg2) |
static void |
log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3) |
static void |
log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4) |
static void |
log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5) |
static void |
log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6) |
static void |
log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7) |
static void |
log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7,
Object arg8) |
static void |
log(String msg) |
static void |
log(String format,
int arg) |
static void |
log(String format,
int arg1,
int arg2) |
static void |
log(String format,
int arg1,
int arg2,
int arg3) |
static void |
log(String format,
int arg1,
Object arg2) |
static void |
log(String format,
Object arg) |
static void |
log(String format,
Object[] args)
Deprecated.
|
static void |
log(String format,
Object arg1,
int arg2) |
static void |
log(String format,
Object arg1,
Object arg2) |
static void |
log(String format,
Object arg1,
Object arg2,
Object arg3) |
static void |
log(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4) |
static void |
log(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5) |
static void |
log(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6) |
static void |
log(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7) |
static void |
log(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7,
Object arg8) |
static Indent |
logAndIndent(int logLevel,
String msg)
A convenience function which combines
log(String) and indent() . |
static Indent |
logAndIndent(int logLevel,
String format,
int arg)
A convenience function which combines
log(String, Object) and indent() . |
static Indent |
logAndIndent(int logLevel,
String format,
int arg1,
int arg2) |
static Indent |
logAndIndent(int logLevel,
String format,
int arg1,
int arg2,
int arg3) |
static Indent |
logAndIndent(int logLevel,
String format,
int arg1,
Object arg2) |
static Indent |
logAndIndent(int logLevel,
String format,
Object arg)
A convenience function which combines
log(String, Object) and indent() . |
static void |
logAndIndent(int logLevel,
String format,
Object[] args)
Deprecated.
|
static Indent |
logAndIndent(int logLevel,
String format,
Object arg1,
int arg2) |
static Indent |
logAndIndent(int logLevel,
String format,
Object arg1,
int arg2,
int arg3) |
static Indent |
logAndIndent(int logLevel,
String format,
Object arg1,
Object arg2) |
static Indent |
logAndIndent(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3) |
static Indent |
logAndIndent(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4) |
static Indent |
logAndIndent(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5) |
static Indent |
logAndIndent(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6) |
static Indent |
logAndIndent(String msg) |
static Indent |
logAndIndent(String format,
int arg) |
static Indent |
logAndIndent(String format,
int arg1,
int arg2) |
static Indent |
logAndIndent(String format,
int arg1,
int arg2,
int arg3) |
static Indent |
logAndIndent(String format,
int arg1,
Object arg2) |
static Indent |
logAndIndent(String format,
Object arg) |
static void |
logAndIndent(String format,
Object[] args)
Deprecated.
|
static Indent |
logAndIndent(String format,
Object arg1,
int arg2) |
static Indent |
logAndIndent(String format,
Object arg1,
int arg2,
int arg3) |
static Indent |
logAndIndent(String format,
Object arg1,
Object arg2) |
static Indent |
logAndIndent(String format,
Object arg1,
Object arg2,
Object arg3) |
static Indent |
logAndIndent(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4) |
static Indent |
logAndIndent(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5) |
static Indent |
logAndIndent(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6) |
static void |
logv(int logLevel,
String format,
Object... args)
Prints a message to the current debug scope's logging stream.
|
static void |
logv(String format,
Object... args) |
static Indent |
logvAndIndent(int logLevel,
String format,
Object... args)
A convenience function which combines
logv(int, String, Object...) and
indent() . |
private static Indent |
logvAndIndentInternal(int logLevel,
String format,
Object... args) |
static DebugMemUseTracker |
memUseTracker(CharSequence name)
Creates a memory use tracker that is enabled iff debugging is
enabled.
|
static DebugMemUseTracker |
memUseTracker(String format,
Object arg)
Creates a debug memory use tracker.
|
static DebugMemUseTracker |
memUseTracker(String format,
Object arg1,
Object arg2)
Creates a debug memory use tracker.
|
static DebugMetric |
metric(CharSequence name)
Creates a metric that is enabled iff debugging is
enabled or the system property whose name is formed by adding to
"jvmci.debug.metric." to
name is
true. |
static DebugMetric |
metric(String format,
Object arg)
Creates a debug metric.
|
static DebugMetric |
metric(String format,
Object arg1,
Object arg2)
Creates a debug metric.
|
protected static void |
parseMetricAndTimerSystemProperties(Set<String> metrics,
Set<String> timers,
Set<String> metricsSubstrings,
Set<String> timersSubstrings) |
static Debug.Scope |
sandbox(CharSequence name,
DebugConfig config,
Object... context)
Creates and enters a new debug scope which will be disjoint from the current debug scope.
|
static Debug.Scope |
scope(Object name)
Similar to
scope(Object, Object[]) but without context objects. |
static Debug.Scope |
scope(Object name,
Object context) |
static Debug.Scope |
scope(Object name,
Object[] contextObjects)
Creates and enters a new debug scope which will be a child of the current debug scope.
|
static Debug.Scope |
scope(Object name,
Object context1,
Object context2) |
static Debug.Scope |
scope(Object name,
Object context1,
Object context2,
Object context3) |
static DebugConfigScope |
setConfig(DebugConfig config)
Changes the debug configuration for the current thread.
|
static DebugConfig |
silentConfig() |
static DebugTimer |
timer(CharSequence name)
Creates a timer that is enabled iff debugging is
enabled or the system property whose name is formed by adding to
"jvmci.debug.timer." to
name is
true. |
static DebugTimer |
timer(String format,
Object arg)
Creates a debug timer.
|
static DebugTimer |
timer(String format,
Object arg1,
Object arg2)
Creates a debug timer.
|
static void |
verify(Object object,
String message)
Calls all
DebugVerifyHandler s in the current config to perform verification on a given object. |
static void |
verify(Object object,
String format,
Object arg)
Calls all
DebugVerifyHandler s in the current config to perform verification on a given object. |
static void |
verify(Object object,
String format,
Object[] args)
Deprecated.
|
private static final boolean ENABLED
public static final int DEFAULT_LOG_LEVEL
private static final DebugMetric VOID_METRIC
private static final DebugMemUseTracker VOID_MEM_USE_TRACKER
public static final String ENABLE_UNSCOPED_TIMERS_PROPERTY_NAME
public static final String ENABLE_UNSCOPED_METRICS_PROPERTY_NAME
public static final String ENABLE_UNSCOPED_MEM_USE_TRACKERS_PROPERTY_NAME
public static final String ENABLE_TIMER_PROPERTY_NAME_PREFIX
timer(CharSequence)
,
Constant Field Valuespublic static final String ENABLE_METRIC_PROPERTY_NAME_PREFIX
metric(CharSequence)
,
Constant Field Valuesprivate static final Set<String> enabledMetrics
null
: no unconditionally enabled metricsisEmpty()
: all metrics are unconditionally enabled!isEmpty()
: use findMatch(Set, Set, String)
on this set and
enabledMetricsSubstrings
to determine which metrics are unconditionally enabledprivate static final Set<String> enabledTimers
enabledMetrics
.private static final Set<String> enabledMetricsSubstrings
private static final Set<String> enabledTimersSubstrings
private static final boolean isUnconditionalMemUseTrackingEnabled
private static final ClassValue<String> formattedClassName
private static final DebugTimer VOID_TIMER
public Debug()
private static boolean initialize()
public static boolean isEnabled()
public static boolean isDumpEnabledForMethod()
public static boolean isDumpEnabled()
public static boolean isDumpEnabled(int dumpLevel)
public static boolean isVerifyEnabledForMethod()
verify(Object, String)
public static boolean isVerifyEnabled()
verify(Object, String)
public static boolean isMeterEnabled()
public static boolean isTimeEnabled()
public static boolean isMemUseTrackingEnabled()
public static boolean isLogEnabledForMethod()
public static boolean isLogEnabled()
public static boolean isLogEnabled(int logLevel)
public static Runnable decorateDebugRoot(Runnable runnable, String name, DebugConfig config)
public static <T> Callable<T> decorateDebugRoot(Callable<T> callable, String name, DebugConfig config)
public static Runnable decorateScope(Runnable runnable, String name, Object... context)
public static <T> Callable<T> decorateScope(Callable<T> callable, String name, Object... context)
public static String currentScope()
'.'
.public static Debug.Scope scope(Object name, Object[] contextObjects) throws Throwable
It is recommended to use the try-with-resource statement for managing entering and leaving debug scopes. For example:
try (Scope s = Debug.scope("InliningGraph", inlineeGraph)) { ... } catch (Throwable e) { throw Debug.handle(e); }The
name
argument is subject to the following type based conversion before having
Object.toString()
called on it:
Type | Conversion ------------------+----------------- java.lang.Class | arg.getSimpleName() |
name
- the name of the new scopecontextObjects
- an array of object to be appended to the current debug contextDebug.Scope.close()
method is calledThrowable
- used to enforce a catch block.public static Debug.Scope scope(Object name)
scope(Object, Object[])
but without context objects. Therefore the catch
block can be omitted.scope(Object, Object[])
public static Debug.Scope scope(Object name, Object context) throws Throwable
context
- an object to be appended to the current debug contextThrowable
scope(Object, Object[])
public static Debug.Scope scope(Object name, Object context1, Object context2) throws Throwable
context1
- first object to be appended to the current debug
contextcontext2
- second object to be appended to the current debug
contextThrowable
scope(Object, Object[])
public static Debug.Scope scope(Object name, Object context1, Object context2, Object context3) throws Throwable
context1
- first object to be appended to the current debug
contextcontext2
- second object to be appended to the current debug
contextcontext3
- third object to be appended to the current debug
contextThrowable
scope(Object, Object[])
public static Debug.Scope sandbox(CharSequence name, DebugConfig config, Object... context) throws Throwable
It is recommended to use the try-with-resource statement for managing entering and leaving debug scopes. For example:
try (Scope s = Debug.sandbox("CompilingStub", null, stubGraph)) { ... } catch (Throwable e) { throw Debug.handle(e); }
name
- the name of the new scopeconfig
- the debug configuration to use for the new scopecontext
- objects to be appended to the current debug contextDebug.Scope.close()
method is calledThrowable
public static Debug.Scope forceLog() throws Throwable
Throwable
public static DebugConfigScope disableIntercept()
try (DebugConfigScope s = Debug.disableIntercept()) { ... }This is particularly useful to suppress extraneous output in JUnit tests that are expected to throw an exception.
public static RuntimeException handle(Throwable exception)
scope(Object)
and
sandbox(CharSequence, DebugConfig, Object...)
is usedpublic static void log(int logLevel, String msg)
msg
- the message to logpublic static void log(int logLevel, String format, Object arg)
format
- a format stringarg
- the argument referenced by the format specifiers in format
public static void log(int logLevel, String format, int arg)
format
- a format stringarg
- the argument referenced by the format specifiers in format
public static void log(int logLevel, String format, Object arg1, Object arg2)
log(int, String, Object)
public static void log(int logLevel, String format, int arg1, Object arg2)
log(int, String, Object)
public static void log(int logLevel, String format, Object arg1, int arg2)
log(int, String, Object)
public static void log(int logLevel, String format, int arg1, int arg2)
log(int, String, Object)
public static void log(int logLevel, String format, Object arg1, Object arg2, Object arg3)
log(int, String, Object)
public static void log(int logLevel, String format, int arg1, int arg2, int arg3)
log(int, String, Object)
public static void log(int logLevel, String format, Object arg1, Object arg2, Object arg3, Object arg4)
log(int, String, Object)
public static void log(String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5)
public static void log(int logLevel, String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5)
log(int, String, Object)
public static void log(String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6)
public static void log(int logLevel, String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6)
log(int, String, Object)
public static void log(String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7)
public static void log(String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8)
public static void log(int logLevel, String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7)
log(int, String, Object)
public static void log(int logLevel, String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8)
public static void logv(int logLevel, String format, Object... args)
log()
methods in this class that take a
fixed number of parameters.format
- a format stringargs
- the arguments referenced by the format specifiers in format
@Deprecated public static void log(String format, Object[] args)
log(String, Object)
is called with one
argument bound to a varargs method parameter. It will bind to this method instead of the
single arg variant and produce a deprecation warning instead of silently wrapping the
Object[] inside of another Object[].@Deprecated public static void log(int logLevel, String format, Object[] args)
log(int, String, Object)
is called with one
argument bound to a varargs method parameter. It will bind to this method instead of the
single arg variant and produce a deprecation warning instead of silently wrapping the
Object[] inside of another Object[].public static void dump(int dumpLevel, Object object, String format, Object arg1, Object arg2, Object arg3)
@Deprecated public static void dump(Object object, String format, Object[] args)
dump(Object, String, Object)
is called with
one argument bound to a varargs method parameter. It will bind to this method instead of the
single arg variant and produce a deprecation warning instead of silently wrapping the
Object[] inside of another Object[].@Deprecated public static void dump(int dumpLevel, Object object, String format, Object[] args)
dump(int, Object, String, Object)
is called
with one argument bound to a varargs method parameter. It will bind to this method instead of
the single arg variant and produce a deprecation warning instead of silently wrapping the
Object[] inside of another Object[].public static void verify(Object object, String message)
DebugVerifyHandler
s in the current config to perform verification on a given object.object
- object to verifymessage
- description of verification contextDebugVerifyHandler.verify(Object, String)
public static void verify(Object object, String format, Object arg)
DebugVerifyHandler
s in the current config to perform verification on a given object.object
- object to verifyformat
- a format string for the description of the verification contextarg
- the argument referenced by the format specifiers in format
DebugVerifyHandler.verify(Object, String)
@Deprecated public static void verify(Object object, String format, Object[] args)
verify(Object, String, Object)
is called
with one argument bound to a varargs method parameter. It will bind to this method instead of
the single arg variant and produce a deprecation warning instead of silently wrapping the
Object[] inside of another Object[].public static Indent indent()
logAndIndent(int, String)
,
logAndIndent(int, String, Object)
public static Indent logAndIndent(String msg)
public static Indent logAndIndent(int logLevel, String msg)
log(String)
and indent()
.msg
- the message to logpublic static Indent logAndIndent(String format, Object arg)
public static Indent logAndIndent(int logLevel, String format, Object arg)
log(String, Object)
and indent()
.format
- a format stringarg
- the argument referenced by the format specifiers in format
public static Indent logAndIndent(String format, int arg)
public static Indent logAndIndent(int logLevel, String format, int arg)
log(String, Object)
and indent()
.format
- a format stringarg
- the argument referenced by the format specifiers in format
public static Indent logAndIndent(String format, int arg1, Object arg2)
public static Indent logAndIndent(int logLevel, String format, int arg1, Object arg2)
logAndIndent(int, String, Object)
public static Indent logAndIndent(String format, Object arg1, int arg2)
public static Indent logAndIndent(int logLevel, String format, Object arg1, int arg2)
logAndIndent(int, String, Object)
public static Indent logAndIndent(String format, int arg1, int arg2)
public static Indent logAndIndent(int logLevel, String format, int arg1, int arg2)
logAndIndent(int, String, Object)
public static Indent logAndIndent(String format, Object arg1, Object arg2)
public static Indent logAndIndent(int logLevel, String format, Object arg1, Object arg2)
logAndIndent(int, String, Object)
public static Indent logAndIndent(String format, Object arg1, Object arg2, Object arg3)
public static Indent logAndIndent(int logLevel, String format, Object arg1, Object arg2, Object arg3)
logAndIndent(int, String, Object)
public static Indent logAndIndent(String format, int arg1, int arg2, int arg3)
public static Indent logAndIndent(int logLevel, String format, int arg1, int arg2, int arg3)
logAndIndent(int, String, Object)
public static Indent logAndIndent(String format, Object arg1, int arg2, int arg3)
public static Indent logAndIndent(int logLevel, String format, Object arg1, int arg2, int arg3)
logAndIndent(int, String, Object)
public static Indent logAndIndent(String format, Object arg1, Object arg2, Object arg3, Object arg4)
public static Indent logAndIndent(int logLevel, String format, Object arg1, Object arg2, Object arg3, Object arg4)
logAndIndent(int, String, Object)
public static Indent logAndIndent(String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5)
public static Indent logAndIndent(int logLevel, String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5)
logAndIndent(int, String, Object)
public static Indent logAndIndent(String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6)
public static Indent logAndIndent(int logLevel, String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6)
logAndIndent(int, String, Object)
public static Indent logvAndIndent(int logLevel, String format, Object... args)
logv(int, String, Object...)
and
indent()
.format
- a format stringargs
- the arguments referenced by the format specifiers in format
private static Indent logvAndIndentInternal(int logLevel, String format, Object... args)
@Deprecated public static void logAndIndent(String format, Object[] args)
logAndIndent(String, Object)
is called with
one argument bound to a varargs method parameter. It will bind to this method instead of the
single arg variant and produce a deprecation warning instead of silently wrapping the
Object[] inside of another Object[].@Deprecated public static void logAndIndent(int logLevel, String format, Object[] args)
logAndIndent(int, String, Object)
is called
with one argument bound to a varargs method parameter. It will bind to this method instead of
the single arg variant and produce a deprecation warning instead of silently wrapping the
Object[] inside of another Object[].public static <T> List<T> contextSnapshot(Class<T> clazz)
public static <T> T contextLookup(Class<T> clazz)
public static DebugMemUseTracker memUseTracker(CharSequence name)
A disabled tracker has virtually no overhead.
public static DebugMemUseTracker memUseTracker(String format, Object arg)
Debug.memUseTracker(format, arg, null)except that the string formatting only happens if metering is enabled.
metric(String, Object, Object)
public static DebugMemUseTracker memUseTracker(String format, Object arg1, Object arg2)
Debug.memUseTracker(String.format(format, arg1, arg2))except that the string formatting only happens if memory use tracking is enabled. In addition, each argument is subject to the following type based conversion before being passed as an argument to
String.format(String, Object...)
:
Type | Conversion ------------------+----------------- java.lang.Class | arg.getSimpleName() |
memUseTracker(CharSequence)
private static DebugMemUseTracker createMemUseTracker(String format, Object arg1, Object arg2)
public static DebugMetric metric(CharSequence name)
name
is
true. If the latter condition is true, then the
returned metric is unconditional otherwise it is
conditional.
A disabled metric has virtually no overhead.
public static String applyFormattingFlagsAndWidth(String s, int flags, int width)
public static DebugMetric metric(String format, Object arg)
Debug.metric(format, arg, null)except that the string formatting only happens if metering is enabled.
metric(String, Object, Object)
public static DebugMetric metric(String format, Object arg1, Object arg2)
Debug.metric(String.format(format, arg1, arg2))except that the string formatting only happens if metering is enabled. In addition, each argument is subject to the following type based conversion before being passed as an argument to
String.format(String, Object...)
:
Type | Conversion ------------------+----------------- java.lang.Class | arg.getSimpleName() |
metric(CharSequence)
private static DebugMetric createMetric(String format, Object arg1, Object arg2)
public static DebugConfigScope setConfig(DebugConfig config)
config
- new configuration to use for the current threadpublic static DebugHistogram createHistogram(String name)
public static DebugConfig silentConfig()
public static DebugConfig fixedConfig(int logLevel, int dumpLevel, boolean isMeterEnabled, boolean isMemUseTrackingEnabled, boolean isTimerEnabled, boolean isVerifyEnabled, Collection<DebugDumpHandler> dumpHandlers, Collection<DebugVerifyHandler> verifyHandlers, PrintStream output)
private static boolean findMatch(Set<String> haystack, Set<String> haystackSubstrings, String needle)
public static boolean areUnconditionalTimersEnabled()
public static boolean areUnconditionalMetricsEnabled()
protected static void parseMetricAndTimerSystemProperties(Set<String> metrics, Set<String> timers, Set<String> metricsSubstrings, Set<String> timersSubstrings)
public static DebugTimer timer(CharSequence name)
name
is
true. If the latter condition is true, then the
returned timer is unconditional otherwise it is
conditional.
A disabled timer has virtually no overhead.
public static DebugTimer timer(String format, Object arg)
Debug.timer(format, arg, null)except that the string formatting only happens if timing is enabled.
timer(String, Object, Object)
public static DebugTimer timer(String format, Object arg1, Object arg2)
Debug.timer(String.format(format, arg1, arg2))except that the string formatting only happens if timing is enabled. In addition, each argument is subject to the following type based conversion before being passed as an argument to
String.format(String, Object...)
:
Type | Conversion ------------------+----------------- java.lang.Class | arg.getSimpleName() |
timer(CharSequence)
public static Object convertFormatArg(Object arg)
private static String formatDebugName(String format, Object arg1, Object arg2)
private static DebugTimer createTimer(String format, Object arg1, Object arg2)