Documentation ¶
Index ¶
- Variables
- func AddHandle(ctx context.Context, handle Handle)
- func Bootstrap(ctx context.Context, configBody []byte) error
- func Debug(ctx context.Context, tag string, fields ...entry.Field)
- func Error(ctx context.Context, tag string, err error, fields ...entry.Field)
- func Fatal(ctx context.Context, tag string, err error, fields ...entry.Field)
- func GetStack(skip int, depth int) string
- func Info(ctx context.Context, tag string, fields ...entry.Field)
- func Notice(ctx context.Context, tag string, fields ...entry.Field)
- func SetLogger(l Logger)
- func Trace(ctx context.Context, tag string, fields ...entry.Field)
- func Warning(ctx context.Context, tag string, err error, fields ...entry.Field)
- func WithField(key string, value interface{}) entry.Field
- type BootstrapConfig
- type Handle
- type Logger
Constants ¶
This section is empty.
Variables ¶
View Source
var TimeFormat = "2006-01-02T15:04:05.999Z07:00"
View Source
var TracingHandle = Handle(func(ctx context.Context, e entry.Entry) []entry.Field { trac := tracing.FromContextOrNew(ctx) return []entry.Field{ WithField("tracingId", trac.Id), WithField("tracingSpanId", trac.SpanId), WithField("tracingStepSize", trac.StepSize), WithField("tracingStartTime", trac.StartTime.Format(TimeFormat)), WithField("tracingEndTime", time.Now().Format(TimeFormat)), WithField("tracingParentSpanId", trac.ParentSpanId), WithField("tracingParentStepSize", trac.ParentStepSize), WithField("tracingDuration", time.Since(trac.StartTime).Milliseconds()), } })
Functions ¶
Types ¶
type BootstrapConfig ¶
type BootstrapConfig struct { Level string `json:"level" yaml:"level"` QueueLength int `yaml:"queueLength"` Dispatchers []struct { Type string `json:"type" yaml:"type"` Formatter string `json:"formatter" yaml:"formatter"` Tags []string `json:"tags" yaml:"tags"` Settings map[string]string `json:"settings" yaml:"settings"` } `json:"dispatchers" yaml:"dispatchers"` }
type Logger ¶
type Logger interface { Fatal(ctx context.Context, tag string, err error, fields ...entry.Field) Error(ctx context.Context, tag string, err error, fields ...entry.Field) Warning(ctx context.Context, tag string, err error, fields ...entry.Field) Info(ctx context.Context, tag string, fields ...entry.Field) Notice(ctx context.Context, tag string, fields ...entry.Field) Debug(ctx context.Context, tag string, fields ...entry.Field) Trace(ctx context.Context, tag string, fields ...entry.Field) SetLevel(level.Level) Flush() AddDispatcher(dispatchers ...dispatcher.Dispatcher) AddHandle(ctx context.Context, handle Handle) Stop() }
Click to show internal directories.
Click to hide internal directories.