Documentation ¶
Overview ¶
Package stacktrace provides support for gathering stack traces efficiently.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
Formatter formats a stack trace into a readable string representation.
func NewFormatter ¶
NewFormatter builds a new Formatter.
func (*Formatter) FormatFrame ¶
FormatFrame formats the given frame.
func (*Formatter) FormatStack ¶
FormatStack formats all remaining frames in the provided stacktrace -- minus the final runtime.main/runtime.goexit frame.
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
Stack is a captured stack trace.
func Capture ¶
Capture captures a stack trace of the specified depth, skipping the provided number of frames. skip=0 identifies the caller of Capture.
The caller must call Free on the returned stacktrace after using it.
func (*Stack) Count ¶
Count reports the total number of frames in this stacktrace. Count DOES NOT change as Next is called.