增加log

This commit is contained in:
lwch
2021-08-24 10:33:26 +08:00
parent 5f63e7f205
commit 6e87aed65a
2 changed files with 3 additions and 2 deletions

View File

@@ -132,7 +132,7 @@ func (h *Handler) readHandshake(c *network.Conn) (string, error) {
}
// onMessage forward message
func (h *Handler) onMessage(msg *network.Msg) {
func (h *Handler) onMessage(conn *network.Conn, msg *network.Msg) {
if msg.GetXType() == network.Msg_keepalive {
return
}
@@ -153,6 +153,7 @@ func (h *Handler) onMessage(msg *network.Msg) {
logging.Error("client %s not found", to)
return
}
logging.Info("link: %s, to: %s, conn: %s, cli: %s, type: %s", linkID, to, conn.RemoteAddr().String(), cli.id, msg.GetXType().String())
h.msgHook(msg, cli)
cli.writeMessage(msg)
}