Documentation ¶
Overview ¶
Package traceutil implements tracing utilities using "context".
Index ¶
- Constants
- type Field
- type Trace
- func (t *Trace) AddField(fields ...Field)
- func (t *Trace) DisableStep()
- func (t *Trace) EnableStep()
- func (t *Trace) GetStartTime() time.Time
- func (t *Trace) InsertStep(at int, time time.Time, msg string, fields ...Field)
- func (t *Trace) Log()
- func (t *Trace) LogIfLong(threshold time.Duration)
- func (t *Trace) LogWithStepThreshold(threshold time.Duration)
- func (t *Trace) SetStartTime(time time.Time)
- func (t *Trace) Step(msg string, fields ...Field)
Constants ¶
View Source
const ( TraceKey = "trace" StartTimeKey = "startTime" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field struct { Key string Value interface{} }
Field is a kv pair to record additional details of the trace.
type Trace ¶
type Trace struct {
// contains filtered or unexported fields
}
func (*Trace) DisableStep ¶
func (t *Trace) DisableStep()
DisableStep sets the flag to prevent the trace from adding steps
func (*Trace) GetStartTime ¶
func (*Trace) InsertStep ¶
func (*Trace) LogWithStepThreshold ¶
LogWithStepThreshold only dumps step whose duration is longer than step threshold
func (*Trace) SetStartTime ¶
Click to show internal directories.
Click to hide internal directories.