Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context interface {
stdctx.Context
Logger
GetContext() stdctx.Context
SetContext(ctx stdctx.Context)
AddTag(keysAndValues ...interface{}) Context
Fork(name string, exporters ...Exporter) Context
Commit(msg string)
}
Context keep the trace info
func NewTraceContext ¶
func NewTraceContext(ctx stdctx.Context, id string) Context
NewTraceContext new a TraceContext
type Exporter ¶
type Exporter func(t *traceContext, duration float64)
Exporter export context info.
func DurationMetric ¶
func DurationMetric(h func(v float64)) Exporter
DurationMetric export context duration metric.
type Logger ¶
type Logger interface {
InfoDepth(depth int, msg string, keysAndValues ...interface{})
Info(msg string, keysAndValues ...interface{})
Error(err error, msg string, keysAndValues ...interface{})
ErrorDepth(depth int, err error, msg string, keysAndValues ...interface{})
Printf(format string, args ...interface{})
V(level int)
}
Logger represents the ability to log messages, both errors and not.
Click to show internal directories.
Click to hide internal directories.