stacktrace

package
v0.0.0-...-2f3eae6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatFrames

func FormatFrames(frames []Frame) string

func GetCallerCodePath

func GetCallerCodePath(skip int, fallback string) string

GetCallerCodePath returns the caller path and line number.

The argument skip is the number of stack frames to skip before identifying the frame to use, with 0 identifying the frame for GetCallerCodePath itself and 1 identifying the caller of GetCallerCodePath.

Types

type Frame

type Frame struct {
	File string `json:"file"`
	Line int    `json:"line"`

	Function string `json:"function"`
}

func GetCallerFrames

func GetCallerFrames(skip int) []Frame

GetCallerFrames returns a slice of Frame objects representing the stack

The skip argument is the number of frames to skip before starting to collect frames, with 0 identifying the frame for GetCallerFrames itself, and 1 identifying the caller of GetCallerFrames

No more than 100 frames will be collected

func (Frame) String

func (f Frame) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL