Skip to content

Commit

Permalink
Merge pull request #5987 from ZQHcode/log-v3.10.x
Browse files Browse the repository at this point in the history
优化sync data打印的日志
  • Loading branch information
breezelxp authored Feb 25, 2022
2 parents 45f110b + 629132d commit 6aff058
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,13 @@ func (h *HostIdentifier) watchToSyncHostIdentifier(events []*IdentifierEvent, ri
for _, event := range events {
isOn, hostIP := getStatusOnAgentIP(strconv.FormatInt(event.CloudID, 10), event.InnerIP, resp.Result_)
if !isOn {
blog.Infof("host %v agent status is off, rid: %s", event, rid)
blog.Infof("agent status is off, hostID: %d, ip: %s, cloudID: %d, rid: %s",
event.HostID, event.InnerIP, event.CloudID, rid)
continue
}

blog.Infof("host %v agent status is on, ip: %s, rid: %s", event, hostIP, rid)
blog.Infof("agent status is on, hostID: %d, ip: %s, cloudID: %d, rid: %s",
event.HostID, hostIP, event.CloudID, rid)

file := h.buildPushFile(event.RawEvent, hostIP, event.CloudID)
fList = append(fList, file)
Expand Down Expand Up @@ -235,7 +237,7 @@ func (h *HostIdentifier) BatchSyncHostIdentifier(hosts []map[string]interface{},
innerIP := util.GetStrByInterface(hostInfo[common.BKHostInnerIPField])
isOn, hostIP := getStatusOnAgentIP(strconv.FormatInt(cloudID, 10), innerIP, resp.Result_)
if !isOn {
blog.Infof("host %v agent status is off, rid: %s", hostInfo, rid)
blog.Infof("agent status is off, hostID: %d, ip: %s, cloudID: %d, rid: %s", hostID, innerIP, cloudID, rid)
continue
}
hostIDs = append(hostIDs, hostID)
Expand Down

0 comments on commit 6aff058

Please sign in to comment.