log

package
v1.4.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

*

  • description: 字段
  • author: jarekzha@gmail.com
  • date: Aug 24, 2022

*

  • description: 初始化
  • author: jarekzha@gmail.com
  • date: Aug 24, 2022

*

  • description: 选项
  • author: jarekzha@gmail.com
  • date: Aug 24, 2022

Package log 日志结构定义

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(opts ...Option)

初始化

func Span added in v1.4.17

func Span(span TraceSpan) zap.Field

Types

type Option

type Option func(cc *Options) Option

func WithDebug

func WithDebug(v bool) Option

func WithLogDir

func WithLogDir(v string) Option

func WithLogFileName

func WithLogFileName(v func(logdir, prefix, processID, suffix string) string) Option

func WithLogSetting

func WithLogSetting(v map[string]interface{}) Option

func WithProcessID

func WithProcessID(v string) Option

type Options

type Options struct {
	Debug       bool
	ProcessID   string
	LogDir      string
	LogFileName func(logdir, prefix, processID, suffix string) string
	LogSetting  map[string]interface{}
}

func NewOptions

func NewOptions(opts ...Option) *Options

type TraceSpan

type TraceSpan interface {

	// Trace is the root ID of the tree that contains all of the spans
	// related to this one.
	TraceID() string

	// Span is an ID that probabilistically uniquely identifies this
	// span.
	SpanID() string

	ExtractSpan() TraceSpan
}

TraceSpan A SpanID refers to a single span.

func CreateTrace

func CreateTrace(trace, span string) TraceSpan

type TraceSpanImp

type TraceSpanImp struct {
	Trace string `json:"Trace"`
	Span  string `json:"Span"`
}

TraceSpanImp TraceSpanImp

func (*TraceSpanImp) ExtractSpan

func (t *TraceSpanImp) ExtractSpan() TraceSpan

ExtractSpan ExtractSpan

func (*TraceSpanImp) SpanID

func (t *TraceSpanImp) SpanID() string

SpanID SpanID

func (*TraceSpanImp) TraceID

func (t *TraceSpanImp) TraceID() string

TraceID TraceID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL