use logrus to project default log tools
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
package common
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type ContextBase struct {
|
||||
Error
|
||||
tag int64
|
||||
tag string
|
||||
}
|
||||
|
||||
//唯一标志
|
||||
func (this *ContextBase) GetTag() int64 {
|
||||
func (this *ContextBase) GetTag() string {
|
||||
|
||||
if this.tag == int64(0) {
|
||||
this.tag = time.Now().UnixNano()
|
||||
if this.tag == "" {
|
||||
this.tag = ObjToStr(time.Now().Unix()) + ":" + ObjToStr(Random())
|
||||
}
|
||||
return this.tag
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user