修改log

This commit is contained in:
lwch
2022-01-17 11:14:44 +08:00
parent 45666bf5ef
commit 3fad19758f
6 changed files with 29 additions and 6 deletions

View File

@@ -146,7 +146,14 @@ func (h *Handler) onMessage(from *client, conn *network.Conn, msg *network.Msg,
return
}
h.msgHook(msg, from, cli, size)
cli.writeMessage(msg)
err := cli.writeMessage(msg)
if err != nil {
logging.Error("write message %s from %s-%d to %s-%d: %v",
msg.GetXType().String(),
msg.GetFrom(), msg.GetFromIdx(),
msg.GetTo(), msg.GetToIdx(),
err)
}
}
func (h *Handler) addLink(name, id string, t network.ConnectRequestType, from, to *client) {