debug

package
v0.0.0-...-c635e59 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0, BSD-2-Clause Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DeadlockDetectionTimeout contains the duration to wait before assuming a deadlock.
	DeadlockDetectionTimeout = 5 * time.Second
)

Functions

func CallerStackTrace

func CallerStackTrace() (stackTrace string)

CallerStackTrace returns a formatted stack trace of the caller of this function.

func ClosureStackTrace

func ClosureStackTrace(functionPointer interface{}) (stackTrace string)

ClosureStackTrace returns a formatted stack trace for the given function pointer.

func DumpGoRoutinesOnShutdown

func DumpGoRoutinesOnShutdown()

DumpGoRoutinesOnShutdown dumps the stack traces of all goroutines on shutdown.

func FunctionName

func FunctionName(functionPointer interface{}) string

FunctionName returns the name of the generic function pointer.

func GetEnabled

func GetEnabled() bool

GetEnabled returns true if the debug mode is active.

func GoroutineID

func GoroutineID() uint64

GoroutineID returns the ID of the current goroutine.

func SetEnabled

func SetEnabled(newEnabled bool)

SetEnabled sets if the debug mode is active.

func StackTrace

func StackTrace(allGoRoutines bool, skipFrames int) string

StackTrace returns a goroutine stack trace. If the allGoRoutines parameter is false, then it only returns the stack trace of the calling goroutine. It is possible to skip the first n frames of the stack trace.

Types

This section is empty.

Jump to

Keyboard shortcuts

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