trace

package
v2.6.21 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugLevel uint8 = iota + 1
	// InfoLevel is the default logging priority.
	InfoLevel
	// WarnLevel logs are more important than Info, but don't need individual
	// human review.
	WarnLevel
	// ErrorLevel logs are high-priority. If an application is running smoothly,
	// it shouldn't generate any error-level logs.
	ErrorLevel
	// DPanicLevel logs are particularly important errors. In development the
	// logger panics after writing the message.
	DPanicLevel
	// PanicLevel logs a message, then panics.
	PanicLevel
	// FatalLevel logs a message, then calls os.Exit(1).
	FatalLevel
)

Variables

This section is empty.

Functions

func Log

func Log() zap.Option

func Print

func Print(msg string) error

func PrintWithData

func PrintWithData(data any, msg string) error

func Printf

func Printf(f string, a ...any) error

func PrintfWithData

func PrintfWithData(data any, f string, a ...any) error

func Start

func Start(bufsize int) error

func StartWithCallback

func StartWithCallback(cb EventCallback)

func Stop

func Stop() error

func With

func With(cb func() error, bufsize int) error

Types

type Breakpoint

type Breakpoint struct {
	ID            int               `cbor:"id" json:"id"`
	Name          string            `cbor:"name,omitempty" json:"name,omitempty"`
	TotalHitCount uint64            `cbor:"total_hit_count,omitempty" json:"total_hit_count,omitempty"`
	HitCount      map[string]uint64 `cbor:"hit_count,omitempty" json:"hit_count,omitempty"`
	Variables     []api.Variable    `cbor:"vars,omitempty" json:"vars,omitempty"`
	Arguments     []api.Variable    `cbor:"args,omitempty" json:"args,omitempty"`
	Locals        []api.Variable    `cbor:"locals,omitempty" json:"locals,omitempty"`
	Stacktrace    []api.Stackframe  `cbor:"stack,omitempty" json:"stack,omitempty"`
}

func (*Breakpoint) Argument

func (b *Breakpoint) Argument(name string) string

func (*Breakpoint) Fprint

func (b *Breakpoint) Fprint(w io.Writer, indent string)

func (*Breakpoint) Local

func (b *Breakpoint) Local(name string) string

func (*Breakpoint) Variable

func (b *Breakpoint) Variable(name string) string

type Event

type Event struct {
	Timestamp  time.Time   `cbor:"time" json:"time"`
	Type       string      `cbor:"type" json:"type"`
	Level      uint8       `cbor:"lvl,omitempty" json:"lvl,omitempty"`
	Message    string      `cbor:"msg,omitempty" json:"msg,omitempty"`
	Source     string      `cbor:"src,omitempty" json:"src,omitempty"`
	PID        int         `cbor:"pid,omitempty" json:"pid,omitempty"`
	Function   string      `cbor:"func,omitempty" json:"func,omitempty"`
	File       string      `cbor:"file,omitempty" json:"file,omitempty"`
	Line       int         `cbor:"line,omitempty" json:"line,omitempty"`
	Breakpoint *Breakpoint `cbor:"breakpoint,omitempty" json:"breakpoint,omitempty"`
	Data       any         `cbor:"data,omitempty" json:"data,omitempty"`
}

func (*Event) Fprint

func (e *Event) Fprint(w io.Writer)

func (*Event) Marshal

func (e *Event) Marshal() ([]byte, error)

func (*Event) MarshalJSON

func (e *Event) MarshalJSON() ([]byte, error)

func (*Event) ReadFrom

func (e *Event) ReadFrom(rd io.Reader) (int64, error)

func (Event) Time

func (e Event) Time() time.Time

func (*Event) Unmarshal

func (e *Event) Unmarshal(b []byte) error

func (*Event) WriteTo

func (e *Event) WriteTo(wr io.Writer) (int64, error)

type EventCallback

type EventCallback func(e Event)

type Stacktrace

type Stacktrace struct {
	Arguments []api.Variable `cbor:"arguments,omitempty" json:"arguments,omitempty"`
	Locals    []api.Variable `cbor:"locals,omitempty" json:"locals,omitempty"`
	Function  string         `cbor:"function,omitempty" json:"function,omitempty"`
	File      string         `cbor:"file,omitempty" json:"file,omitempty"`
	Line      int            `cbor:"line,omitempty" json:"line,omitempty"`
}

Jump to

Keyboard shortcuts

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