From a0e11e37000b85fb5fbb6f71021f50d88c5e0e31 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期四, 07 一月 2021 17:42:46 +0800 Subject: [PATCH] 减少日志数量 --- hbusc.go | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hbusc.go b/hbusc.go index 75c4f1c..aa97e57 100644 --- a/hbusc.go +++ b/hbusc.go @@ -373,33 +373,33 @@ Topic: TOPIC_QUERYKEY, Body: []byte(topic), }) - h.printLog("marshal req err:", err) if err != nil { return nil, fmt.Errorf("marshal req err:%s", err.Error()) } var ret []bhomebus.Mesg n := h.sockWorker.sock.SendandrecvTimeout(reqNetNode, reqD, &ret, h.conf.sendTimeOut) - h.printLog("getNetNodeByTopic ret n:", n) if n > 0 { var reply CommonReply err = json.Unmarshal(ret[0].Data, &reply) - h.printLog("unmarshal err:", err) if err != nil { + h.printLog("unmarshal err:", err) return nil, err } - h.printLog("reply.Status:", reply.Status) + if reply.Status == REPLY_SUCCESS { err = json.Unmarshal(reply.Body, &nodes) - h.printLog("unmarshal err:", err, "nodes:", nodes) if err == nil { return nodes, nil } else { + h.printLog("unmarshal err:", err, "nodes:", nodes) return nil, fmt.Errorf("unmarshal reply.Body err:%s", err.Error()) } } else { + h.printLog("reply.Status:", reply.Status) return nil, fmt.Errorf("REPLY STATUS:%d", reply.Status) } } else { + h.printLog("getNetNodeByTopic ret n:", n) return nil, fmt.Errorf("GetNetNodeByTopic n:%d", n) } } -- Gitblit v1.8.0