|
@@ -3,7 +3,8 @@ package main
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
- "jy_publishing/Logger"
|
|
|
+ "go.uber.org/zap"
|
|
|
+ . "jy_publishing/Logger"
|
|
|
ms "jy_publishing/megaloscope"
|
|
|
nsq "jy_publishing/nsq"
|
|
|
"jy_publishing/tool"
|
|
@@ -21,7 +22,7 @@ var (
|
|
|
)
|
|
|
|
|
|
func init() {
|
|
|
- Logger.InitLogger("./log/All.log", "debug")
|
|
|
+ InitLogger("./log/All.log", "debug")
|
|
|
util.ReadConfig(&tool.Sysconfig)
|
|
|
//信息类型
|
|
|
if tool.Sysconfig["infoCode"] != nil {
|
|
@@ -147,7 +148,7 @@ func processUdpMsg(act byte, data []byte, ra *net.UDPAddr) {
|
|
|
case udp.OP_TYPE_DATA: //测试接收
|
|
|
var resp map[string]interface{}
|
|
|
err := json.Unmarshal(data, &resp)
|
|
|
- Logger.Info("udp receive...", Logger.Field("data", resp))
|
|
|
+ Logger.Info("udp receive...", zap.Any("data", resp))
|
|
|
if err != nil {
|
|
|
//go Udpclient.WriteUdp([]byte{}, mu.OP_NOOP, ra) //回应上一个节点
|
|
|
} else if resp != nil {
|
|
@@ -165,7 +166,7 @@ func processUdpMsg(act byte, data []byte, ra *net.UDPAddr) {
|
|
|
}
|
|
|
}
|
|
|
case udp.OP_NOOP: //下个节点回应
|
|
|
- Logger.Info("接收回应:", Logger.Field("data", string(data)))
|
|
|
+ Logger.Info("接收回应:", zap.Any("data", string(data)))
|
|
|
}
|
|
|
|
|
|
}
|