tracing

package
v0.6.59 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = Log

Functions

func WithTrace

func WithTrace(ctx context.Context, t Trace) context.Context

WithTrace returns the context with the given Trace

Types

type Trace

type Trace uint8
const (
	None   Trace = 0
	Perf   Trace = 1 << 0
	CPU    Trace = 1 << 1
	Memory Trace = 1 << 2
	Opa    Trace = 1 << 3
	Log    Trace = 1 << 4
	All    Trace = Perf | CPU | Memory | Opa | Log
)

func FromContext

func FromContext(ctx context.Context) Trace

FromContext returns the stored Trace in context or Default

func ParseTrace

func ParseTrace(s string) Trace

ParseTrace returns a Trace for the given comma separated string value

func (Trace) Enabled

func (t Trace) Enabled(categories ...Trace) bool

Enabled returns true if one of the provided tracing categories is enabled

func (*Trace) Set

func (t *Trace) Set(s string) error

func (Trace) String

func (t Trace) String() string

String returns a comma separated list of enabled categories

func (Trace) Type

func (Trace) Type() string

Jump to

Keyboard shortcuts

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