Skip to content

Commit

Permalink
Fix duplicate log printing in cluster\agent.go.
Browse files Browse the repository at this point in the history
  • Loading branch information
werbenhu committed Oct 8, 2023
1 parent e130f97 commit e5dfe4c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions cluster/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,20 +470,18 @@ func OnApplyLog(leaderId, nodeId string, tp byte, filter []byte, prompt string,

func OnPublishPacketLog(direction byte, nodeId, cid, topic string, pid uint16) {
if direction == DirectionInbound {
log.Info("", "d", "inbound", "from", nodeId)
log.Info("publish message", "d", "inbound", "from", nodeId, "cid", cid, "pid", pid, "topic", topic)
} else {
log.Info("", "d", "outbound", "to", nodeId)
log.Info("publish message", "d", "outbound", "to", nodeId, "cid", cid, "pid", pid, "topic", topic)
}
log.Info("publish message", "cid", cid, "pid", pid, "topic", topic)
}

func OnConnectPacketLog(direction byte, node, clientId string) {
if direction == DirectionInbound {
log.Info("", "d", "inbound", "from", node)
log.Info("connection notification", "d", "inbound", "from", node, "cid", clientId)
} else {
log.Info("", "d", "outbound", "to", node)
log.Info("connection notification", "d", "outbound", "to", node, "cid", clientId)
}
log.Info("connection notification", "cid", clientId)
}

func (a *Agent) Join(nodeName, addr string) error {
Expand Down

0 comments on commit e5dfe4c

Please sign in to comment.