From 811ab786a196ae91fee0d6ce8ead07973e3df099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=AE=87?= Date: Thu, 9 May 2019 23:06:42 +1200 Subject: [PATCH] Added some logs to chat app. --- cmd/apps/chat/chat.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/apps/chat/chat.go b/cmd/apps/chat/chat.go index 123e823c9b..bc1df2936b 100644 --- a/cmd/apps/chat/chat.go +++ b/cmd/apps/chat/chat.go @@ -82,7 +82,9 @@ func handleConn(conn net.Conn) { clientMsg, _ := json.Marshal(map[string]string{"sender": raddr.PubKey.Hex(), "message": string(buf[:n])}) // nolint select { case clientCh <- string(clientMsg): + log.Printf("received and sent to ui: %s\n", clientMsg) default: + log.Printf("received and trashed: %s\n", clientMsg) } } }