public class Tracer extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static Class<? extends Throwable>[] |
ignoreClasses |
protected static Class<? extends Throwable>[] |
traceClasses |
| Modifier | Constructor and Description |
|---|---|
protected |
Tracer() |
| Modifier and Type | Method and Description |
|---|---|
static Class<? extends Throwable>[] |
getExceptionsToIgnore()
Get exception classes to ignore.
|
static Class<? extends Throwable>[] |
getExceptionsToTrace()
Get exception classes to trace.
|
static void |
setExceptionsToIgnore(Class<? extends Throwable>... ignoreClasses)
Set exceptions to ignore.
|
static void |
setExceptionsToTrace(Class<? extends Throwable>... traceClasses)
Set exception to trace.
|
protected static boolean |
shouldTrace(Throwable t)
Check whether the throwable should be traced.
|
static void |
trace(Throwable e)
Trace provided
Throwable and increment exception count to entry in current context. |
static void |
trace(Throwable e,
int count)
Trace provided
Throwable and add exception count to entry in current context. |
static void |
traceContext(Throwable e,
int count,
Context context)
Trace provided
Throwable and add exception count to current entry in provided context. |
static void |
traceEntry(Throwable e,
Entry entry)
Trace provided
Throwable and increment exception count to provided entry. |
static void |
traceEntry(Throwable e,
int count,
Entry entry)
Trace provided
Throwable and add exception count to provided entry. |
public static void trace(Throwable e)
Throwable and increment exception count to entry in current context.e - exception to recordpublic static void trace(Throwable e, int count)
Throwable and add exception count to entry in current context.e - exception to recordcount - exception count to addpublic static void traceContext(Throwable e, int count, Context context)
Throwable and add exception count to current entry in provided context.e - exception to recordcount - exception count to addpublic static void traceEntry(Throwable e, Entry entry)
Throwable and increment exception count to provided entry.e - exception to recordpublic static void traceEntry(Throwable e, int count, Entry entry)
Throwable and add exception count to provided entry.e - exception to recordcount - exception count to add@SafeVarargs public static void setExceptionsToTrace(Class<? extends Throwable>... traceClasses)
BlockException will be traced.
Note that if both setExceptionsToIgnore(Class[]) and this method is set,
the ExceptionsToIgnore will be of higher precedence.
traceClasses - the list of exception classes to trace.public static Class<? extends Throwable>[] getExceptionsToTrace()
@SafeVarargs public static void setExceptionsToIgnore(Class<? extends Throwable>... ignoreClasses)
BlockException will be traced.
Note that if both setExceptionsToTrace(Class[]) and this method is set,
the ExceptionsToIgnore will be of higher precedence.
ignoreClasses - the list of exception classes to ignore.public static Class<? extends Throwable>[] getExceptionsToIgnore()
protected static boolean shouldTrace(Throwable t)
t - the throwable to check.Copyright © 2019 Alibaba Group. All rights reserved.