Documentation ¶
Index ¶
- Variables
- func ContextWithConstantTraceID(ctx context.Context, traceID string) context.Context
- func ContextWithTraceID(ctx context.Context) (context.Context, bool)
- func ContextWithoutTraceID(ctx context.Context) context.Context
- func FormatEventLogFields(ctx context.Context, details []Detail) []zapcore.Field
- func FormatStepLogFields(ctx context.Context, details []Detail, mutators ...StepMutator) []zapcore.Field
- func FormatSubscribeLogFields(ctx context.Context, targetName string, targetDetails []Detail, ...) []zapcore.Field
- func FormatTraceLogFields(ctx context.Context) []zapcore.Field
- func GetTraceIDFromContext(ctx context.Context) string
- func LogError(ctx context.Context, logger *zap.Logger, text string, err error, ...) error
- func LogFatalError(ctx context.Context, logger *zap.Logger, text string, err error, ...) error
- func LogStep(ctx context.Context, logger *zap.Logger, text string, mutators ...StepMutator)
- func LogTraceEnd(ctx context.Context, logger *zap.Logger, text string, mutators ...StepMutator)
- func LogTraceStart(ctx context.Context, logger *zap.Logger, text string)
- func Section(ctx context.Context, logger *zap.Logger, name string) (context.Context, bool, func(error, string, ...StepMutator))
- func SimpleSection(ctx context.Context, logger *zap.Logger, name string) func(error, ...StepMutator)
- type Detail
- type Event
- type LogType
- type StatusType
- type Step
- type StepMutator
- func Status(st StatusType) StepMutator
- func UpdateTraceName(newTitle string) StepMutator
- func WithCIDDetail(name string, cidBytes []byte) StepMutator
- func WithDetail(name string, description string) StepMutator
- func WithError(err error) StepMutator
- func WithJSONDetail(name string, val interface{}) StepMutator
- type Subscribe
- type Trace
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NewSessionID = newID NewTraceID = newID )
View Source
var KnownLogTypes = []LogType{TraceType, StepType, EventType, SubscribeType}
Functions ¶
func FormatEventLogFields ¶
func FormatStepLogFields ¶
func GetTraceIDFromContext ¶
func LogFatalError ¶
func LogTraceEnd ¶
func SimpleSection ¶
Types ¶
type StatusType ¶
type StatusType string
const ( Running StatusType = "running" Succeeded StatusType = "succeeded" Failed StatusType = "failed" )
type Step ¶
type Step struct { ParentTraceID string `json:"parentTraceID"` Details []Detail `json:"details"` Status StatusType `json:"status"` EndTrace bool `json:"endTrace"` UpdateTraceName string `json:"updateTraceName"` ForceReopen bool `json:"forceReopen"` }
func ForceReopen ¶
type StepMutator ¶
func Status ¶
func Status(st StatusType) StepMutator
func UpdateTraceName ¶
func UpdateTraceName(newTitle string) StepMutator
func WithCIDDetail ¶
func WithCIDDetail(name string, cidBytes []byte) StepMutator
func WithDetail ¶
func WithDetail(name string, description string) StepMutator
func WithError ¶
func WithError(err error) StepMutator
func WithJSONDetail ¶
func WithJSONDetail(name string, val interface{}) StepMutator
Source Files ¶
Click to show internal directories.
Click to hide internal directories.