feat: improve logging for client connects and disconnects
- add connection log to record client address on connect
- enhance disconnection log to include client address
🤖
This commit is contained in:
parent
f991ba885d
commit
c6ce7d46ad
2 changed files with 3 additions and 1 deletions
|
@ -18,7 +18,7 @@ func handleClientCommands(ws *websocket.Conn) {
|
|||
|
||||
_, message, err := ws.ReadMessage()
|
||||
if err != nil {
|
||||
log.Printf("Client disconnected: %v", err)
|
||||
log.Printf("Client disconnected from %s (%v)", ws.NetConn().RemoteAddr(), err)
|
||||
delete(Clients, ws)
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue