tracing

package
v0.0.0-...-aefa52a Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTraceable

func IsTraceable(v any) bool

IsTraceable returns true if the given value implements the Tracer interface.

func Trace

func Trace(v any) string

Trace returns the stack trace of the given value. If the value does not implement the Tracer interface, an empty string is returned.

Types

type Traceable

type Traceable struct {
	// contains filtered or unexported fields
}

Traceable is a struct that holds a stack trace.

func NewTraces

func NewTraces(skip int) Traceable

NewTraces returns a new Traceable struct with the stack trace of the calling function.

func (Traceable) Frames

func (f Traceable) Frames() []uintptr

Frames returns the stack trace as a slice of uintptrs.

func (Traceable) Trace

func (f Traceable) Trace() string

Trace returns the trace as a string.

type Tracer

type Tracer interface {
	Trace() string
}

Tracer is an interface for anything that has a stack trace pointing to where it was created.

Jump to

Keyboard shortcuts

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