Documentation ¶
Index ¶
- Variables
- func FormatStack() ([]byte, error)
- func GetCallStackTrace() string
- func GetCaller() string
- func GetCallerWithSkip(skip int) string
- func GetMetadata(ctx context.Context, key string) []string
- func GetShortCaller() string
- func GoroutineID() uint64
- func Must(err error)
- func NameOfFunction(f interface{}) string
- func Recover()
- func RecoverFromPanic(err *error)
Constants ¶
This section is empty.
Variables ¶
var PanicHandlers = []func(interface{}){logPanic}
PanicHandlers is a list of functions which will be invoked when a panic happens.
Functions ¶
func FormatStack ¶ added in v0.0.95
func GetCallStackTrace ¶ added in v0.0.60
func GetCallStackTrace() string
func GetCallerWithSkip ¶
GetCaller returns the caller of the function that calls it. The argument skip is the number of stack frames to skip before recording in pc, with 0 identifying the frame for Callers itself and 1 identifying the caller of Callers
func GetShortCaller ¶
func GetShortCaller() string
func Must ¶ added in v0.0.80
func Must(err error)
Must panics on non-nil errors. Useful to handling programmer level errors
func NameOfFunction ¶ added in v0.0.74
func NameOfFunction(f interface{}) string
func Recover ¶ added in v0.0.60
func Recover()
must use defer Recover() not effective for calling defer func() {Recover()}()
func RecoverFromPanic ¶ added in v0.0.60
func RecoverFromPanic(err *error)
RecoverFromPanic replaces the specified error with an error containing the original error, and the call tree when a panic occurs. This enables error handlers to handle errors and panics the same way.
Types ¶
This section is empty.