Documentation
¶
Overview ¶
Package stacktrace provides you a StackTrace type that contains both the list of the runtime.Frame of the stacktrace, and the printed format fo debug.Stack(), so you can choose which format you want to use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StackTrace ¶
type StackTrace struct {
// contains filtered or unexported fields
}
StackTrace wrap two information: - the stacktrace as a string from debug.Stack() - the list of the frames coming from runtime.Callers()
func (StackTrace) Frames ¶
func (st StackTrace) Frames() []runtime.Frame
Frames return the list of runtime.Frame, built using runtime.Callers().
func (StackTrace) Last ¶
func (st StackTrace) Last() (runtime.Frame, bool)
Last return the LastFrame outside the vendors and the go source files.
func (StackTrace) LastFrame ¶
LastFrame will return the last frame in the stacktrace, ignoring go source files if ignoreGo is set to true, and ignoring files containing the strings provided in ignoredFiles. It can happen that all frames are ignored, so you need to check if LastFrame is returning true
func (StackTrace) String ¶
func (st StackTrace) String() string
String returns the stacktrace as a string, with the same format as debug.Stack()