Skip to content

Commit

Permalink
Added some logs to chat app.
Browse files Browse the repository at this point in the history
  • Loading branch information
林志宇 committed May 9, 2019
1 parent 83d0477 commit 811ab78
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/apps/chat/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit 811ab78

Please sign in to comment.