use logrus to project default log tools

This commit is contained in:
hoteas
2021-05-25 05:08:17 +08:00
parent 9bc930750d
commit df07afb744
15 changed files with 491 additions and 457 deletions
+7 -5
View File
@@ -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
}