Documentation ¶
Index ¶
- Constants
- Variables
- func Check(ctx context.Context) bool
- func WithContext(ctx, spanCtx context.Context) context.Context
- type Config
- type Context
- type Event
- type Field
- type FileRotationConfig
- type Level
- type Logger
- type Span
- type SpanContext
- type SpanLogger
- type Tracer
- func (t *Tracer) Handler() http.Handler
- func (t *Tracer) Start(ctx context.Context, span string) (context.Context, Span)
- func (t *Tracer) WithConfig(conf Config) *Tracer
- func (t *Tracer) WithExporter(maxSize int, secret string) *Tracer
- func (t *Tracer) WithFile(filename string, conf *FileRotationConfig) *Tracer
- func (t *Tracer) WithStdout(colored bool) *Tracer
- func (t *Tracer) WithWriter(w io.Writer) *Tracer
Constants ¶
View Source
const ExporterSecretHeader = "X-Exporter-Secret"
Variables ¶
View Source
var ( FieldTimeFormat = time.RFC3339Nano FieldDurationUnit = time.Second FieldDurationInteger = false )
View Source
var DefaultLogger = zerolog.New(os.Stdout). Level(zerolog.TraceLevel). With().Timestamp().Caller(). Logger()
View Source
var LoggerErrorHandler func(error) = func(error) {}
Functions ¶
Types ¶
type Field ¶
type Field = string
const ( FieldID Field = "_id" FieldService Field = "_service" FieldBranch Field = "_branch" FieldParent Field = "_parent" FieldSpan Field = "_span" FieldDuration Field = "_duration" FieldLevel Field = "_level" FieldMessage Field = "_message" FieldError Field = "_error" FieldErrorStack Field = "_stack" FieldFile Field = "_file" FieldTime Field = "_time" )
type FileRotationConfig ¶
type Span ¶
type Span interface { SpanLogger Finish() }
type SpanContext ¶
func FromContext ¶
func FromContext(ctx context.Context) SpanContext
func StartSpanContext ¶
func StartSpanContext(ctx context.Context, spanName string) SpanContext
type SpanLogger ¶
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
func (*Tracer) WithConfig ¶
func (*Tracer) WithFile ¶
func (t *Tracer) WithFile(filename string, conf *FileRotationConfig) *Tracer
func (*Tracer) WithStdout ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.