stacktrace

package module
v0.0.0-...-444a4ed Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

README

stacktrace

Stacktrace is a simple library that gives you the ability to quickly log stacktrace.

How-to

as a string:

trace := stacktrace.NewStackTrace(0)
tj, err := trace.ToJson()
if err != nil {
	log.Println(err)
	return
}
fmt.Println(tj, err)

as a reader:

trace := stacktrace.NewStackTrace(0)
b, err := ioutil.ReadAll(trace)
if err != nil {
	log.Println(err)
	return
}
fmt.Println(string(b), err)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StackTrace

type StackTrace struct {
	Caller     string `json:"caller"`
	StackTrace string `json:"stack_trace"`
	// contains filtered or unexported fields
}

func NewStackTrace

func NewStackTrace(skip int) *StackTrace

func (*StackTrace) Read

func (t *StackTrace) Read(p []byte) (n int, err error)

func (*StackTrace) ToJson

func (t *StackTrace) ToJson() (io.Reader, error)

func (*StackTrace) ToJsonString

func (t *StackTrace) ToJsonString() (string, error)

Jump to

Keyboard shortcuts

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