public class ThrowableCallStack extends java.lang.Object implements CallStack
Throwable
. This strategy, while slower than the
SecurityManager implementation, provides call stack method names and other metadata in addition to the call stack
of classes.Throwable.fillInStackTrace()
构造器和说明 |
---|
ThrowableCallStack(java.lang.String messageFormat,
boolean useTimestamp)
Create a new instance.
|
限定符和类型 | 方法和说明 |
---|---|
void |
clear()
Clears the current stack trace snapshot.
|
void |
fillInStackTrace()
Takes a snapshot of the current call stack.
|
boolean |
printStackTrace(java.io.PrintWriter writer)
Prints the current stack trace if available to a PrintWriter.
|
public ThrowableCallStack(java.lang.String messageFormat, boolean useTimestamp)
messageFormat
- message formatuseTimestamp
- whether to format the dates in the output message or notpublic void clear()
CallStack
CallStack.printStackTrace(PrintWriter)
will be
no-ops until another call to CallStack.fillInStackTrace()
.public void fillInStackTrace()
CallStack
CallStack.printStackTrace(PrintWriter)
will print
out that stack trace until it is cleared.fillInStackTrace
在接口中 CallStack
public boolean printStackTrace(java.io.PrintWriter writer)
CallStack
PooledObject
usage in user code.printStackTrace
在接口中 CallStack
writer
- a PrintWriter to write the current stack trace to if available