优化日志

This commit is contained in:
duanhf2012
2024-09-20 15:17:44 +08:00
parent e6c09064bf
commit 1cf071a444
5 changed files with 8 additions and 12 deletions

View File

@@ -328,13 +328,13 @@ func startNode(args interface{}) error {
myName, mErr := sysprocess.GetMyProcessName()
//当前进程名获取失败,不应该发生
if mErr != nil {
log.SInfo("get my process's name is error,", mErr.Error())
log.Info("get my process's name is error",log.ErrorAttr("err", mErr))
os.Exit(-1)
}
//进程id存在而且进程名也相同被认为是当前进程重复运行
if cErr == nil && name == myName {
log.SInfo(fmt.Sprintf("repeat runs are not allowed,node is %s,processid is %d",strNodeId,processId))
log.Info("repeat runs are not allowed",log.String("nodeId",strNodeId),log.Int("processId",processId))
os.Exit(-1)
}
break