Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallerFrame ¶
CallerFrame returns single caller frame. The argument skip is the number of stack frames to skip before recording frames, skip=0 means the caller frame and skip=1 means the caller of the caller. CallerFrame returns zero-value of runtime.Frame when there is no frames to report. See also runtime.Caller.
func CallerFrames ¶
CallerFrames returns a slice of caller frames. The argument skip is the number of stack frames to skip before recording frames, skip=0 means the caller frame and skip=1 means the caller of the caller. CallerFrames returns nil slice of runtime.Frame when there is no frames to report. CallerFrames returns 64 frames at maximum. See also runtime.CallersFrames.
Types ¶
type Frame ¶
type Frame struct { // Pkg is go package name of the caller. Pkg string `json:"pkg" msgpack:"pkg" xml:"pkg" yaml:"pkg"` // File is the file name of the caller. File string `json:"file" msgpack:"file" xml:"file" yaml:"file"` // Func is the function name of the caller. Func string `json:"func" msgpack:"func" xml:"func" yaml:"func"` // Line is the line number of the caller. Line int `json:"line" msgpack:"line" xml:"line" yaml:"line"` }
Frame holds stack frame information. See also runtime.Frame.
func ConvertFrame ¶
ConvertFrame converts runtime.Frame into Frame. ConvertFrame returns zero value of Frame if the given frame is empty.
func ConvertFrames ¶
ConvertFrames converts a slice of runtime.Frame into a slice of Frame. ConvertFrames returns nil slice if the given slice is empty.