stack

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuncName

func FuncName(fn *runtime.Func) string

FuncName given a runtime function spec returns a short function name in format `<package name>.<function name>` or if the function has a receiver in format `<package name>.(<receiver>).<function name>`.

func GetCallStack

func GetCallStack(frames errors.StackTrace) string

func GoRoutineID

func GoRoutineID() uint64

Returns the current goroutine id

logrus.Infof("[%d] Info about this go routine", stack.GoRoutineID())

Types

type FrameInfo

type FrameInfo struct {
	CallStack string
	Func      string
	File      string
	LineNo    int
}

func GetLastFrame

func GetLastFrame(frames errors.StackTrace) FrameInfo

Returns Caller information on the first frame in the stack trace

type HasStackTrace

type HasStackTrace interface {
	StackTrace() errors.StackTrace
}

type Stack

type Stack []uintptr

stack represents a stack of program counters.

func New

func New(skip int) *Stack

Creates a new Stack{} struct from current stack minus 'skip' number of frames

func (*Stack) Format

func (s *Stack) Format(st fmt.State, verb rune)

func (*Stack) StackTrace

func (s *Stack) StackTrace() errors.StackTrace

Jump to

Keyboard shortcuts

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