mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
替换slog日志为zap
This commit is contained in:
@@ -281,7 +281,7 @@ func (m *Module) SafeNewTicker(tickerId *uint64, d time.Duration, AdditionData i
|
||||
|
||||
func (m *Module) CancelTimerId(timerId *uint64) bool {
|
||||
if timerId == nil || *timerId == 0 {
|
||||
log.Warning("timerId is invalid")
|
||||
log.Warn("timerId is invalid")
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ func (m *Module) CancelTimerId(timerId *uint64) bool {
|
||||
|
||||
t, ok := m.mapActiveIdTimer[*timerId]
|
||||
if ok == false {
|
||||
log.Stack("cannot find timer id ", log.Uint64("timerId", *timerId))
|
||||
log.StackError("cannot find timer id ", log.Uint64("timerId", *timerId))
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
"github.com/duanhf2012/origin/v2/rpc"
|
||||
"github.com/duanhf2012/origin/v2/util/timer"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
@@ -261,10 +260,7 @@ func (s *Service) SetName(serviceName string) {
|
||||
func (s *Service) Release() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
buf := make([]byte, 4096)
|
||||
l := runtime.Stack(buf, false)
|
||||
errString := fmt.Sprint(r)
|
||||
log.Dump(string(buf[:l]), log.String("error", errString))
|
||||
log.StackError(fmt.Sprint(r))
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ func Init() {
|
||||
for _,s := range setupServiceList {
|
||||
err := s.OnInit()
|
||||
if err != nil {
|
||||
log.Error("Failed to initialize "+s.GetName()+" service",log.ErrorAttr("err",err))
|
||||
log.Error("Failed to initialize "+s.GetName()+" service",log.ErrorField("err",err))
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user