zlog

package
v0.0.0-...-473e0bf Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Zlog

type Zlog struct {
	// contains filtered or unexported fields
}

func GetZlog

func GetZlog() *Zlog

GetZlog 获取跟踪ID实例

##### Example

```go

z := zlog.GetZlog()
logrus.WithFields(z.Fields(logrus.Fields{"key": value})).Info("main")

```

func (*Zlog) AddID

func (this *Zlog) AddID(id string) *Zlog

AddID 手动添加跟踪ID.

func (*Zlog) Clean

func (this *Zlog) Clean()

Clean 清除跟踪ID

func (*Zlog) Error

func (this *Zlog) Error(str string) error

func (*Zlog) Fields

func (this *Zlog) Fields(f map[string]interface{}) map[string]interface{}

Fields 在提供的f基础上增加跟踪ID

func (*Zlog) MyTrack

func (this *Zlog) MyTrack() string

MyTrack 获取当前跟踪ID

Jump to

Keyboard shortcuts

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