-- import "github.com/andy-zhangtao/gogather/zlog"
type Zlog struct {
}
func GetZlog() *Zlog
GetZlog 获取跟踪ID实例
z := zlog.GetZlog()
logrus.WithFields(z.Fields(logrus.Fields{"key": value})).Info("main")
func (this *Zlog) AddID(id string) *Zlog
AddID 手动添加跟踪ID.
func (this *Zlog) Clean()
Clean 清除跟踪ID
func (this *Zlog) Error(str string) error
func (this *Zlog) Fields(f map[string]interface{}) map[string]interface{}
Fields 在提供的f基础上增加跟踪ID
func (this *Zlog) MyTrack() string
MyTrack 获取当前跟踪ID