tracer

package
v3.4.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: GPL-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var STACKLOGGER_ALLOWED_FILES []string = make([]string, 0)
View Source
var STACKLOGGER_DISALLOWED_FILES []string = make([]string, 0)
View Source
var STACKLOGGER_UNSAFE bool = true

Functions

func Allow

func Allow(files ...string)

func AllowPackage

func AllowPackage(pkgname string)

func Disallow

func Disallow(files ...string)

func DisallowPackage

func DisallowPackage(pkgname string)

Types

type Caller

type Caller struct {
	File         string `json:"file"`
	Line         int    `json:"line"`
	FunctionName string `json:"function_name"`
}

func (*Caller) Read

func (c *Caller) Read(amountOfLines int) (*fileFrame, error)

func (*Caller) String

func (c *Caller) String() string

type Callers

type Callers struct {
	Callers StackTrace
	// contains filtered or unexported fields
}

func (*Callers) Error

func (c *Callers) Error() string

func (*Callers) String

func (c *Callers) String() string

func (*Callers) Trace

func (c *Callers) Trace() StackTrace

func (*Callers) Unwrap

func (c *Callers) Unwrap() error

type ErrorType

type ErrorType interface {
	Error() string
	Trace() StackTrace
	Unwrap() error
}

Error is an error with stack trace. It consists of callers and the error supplied.

func Trace

func Trace(err error, stackLen, skip int) ErrorType

func TraceSafe

func TraceSafe(err error, stackLen, skip int) ErrorType

Get a stacktrace of the current goroutine.

stackLen is the number of stack frames to get.

skip is the number of stack frames to skip.

It will be default skip the first two frames, this means it will return out the function that called this function last.

type StackTrace

type StackTrace []Caller // A stacktrace is a slice of callers.

func (StackTrace) Filter

func (s StackTrace) Filter(filter func(Caller) bool) []Caller

Filter the stacktrace by caller.

func (StackTrace) String

func (s StackTrace) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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