优化日志服务增加前缀以及取消日志的日期目录

This commit is contained in:
boyce
2019-09-05 13:21:57 +08:00
parent 52a3122044
commit ca63245a93
5 changed files with 42 additions and 31 deletions

View File

@@ -5,7 +5,6 @@ import (
"math/rand"
"net"
"os"
"strconv"
"strings"
"time"
@@ -192,29 +191,9 @@ func (slf *CCluster) ConnService() error {
return nil
}
func (slf *CCluster) Init() error {
if len(os.Args) < 2 {
return fmt.Errorf("Param error not find NodeId=number")
}
parts := strings.Split(os.Args[1], "=")
if len(parts) < 2 {
return fmt.Errorf("Param error not find NodeId=number")
}
if parts[0] != "NodeId" {
return fmt.Errorf("Param error not find NodeId=number")
}
func (slf *CCluster) Init(currentNodeid int) error {
slf.nodeclient = make(map[int]*RpcClient)
//读取配置
currentNodeid, err := strconv.Atoi(parts[1])
if err != nil {
return err
}
return slf.ReadNodeInfo(currentNodeid)
}