From dd69a7e27f1e97a21239dfbb65c5a39439561d1b Mon Sep 17 00:00:00 2001 From: Bruce Marriner Date: Thu, 28 Apr 2016 09:27:57 -0500 Subject: [PATCH] Added logging statements --- voice.go | 2 ++ wsapi.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/voice.go b/voice.go index b855aa5..44b3666 100644 --- a/voice.go +++ b/voice.go @@ -126,6 +126,7 @@ func (v *VoiceConnection) Disconnect() (err error) { // Close websocket and udp connections v.Close() + v.log(LogInformational, "Deleting VoiceConnection %s", v.GuildID) delete(v.session.VoiceConnections, v.GuildID) return @@ -428,6 +429,7 @@ func (v *VoiceConnection) wsHeartbeat(wsConn *websocket.Conn, close <-chan struc var err error ticker := time.NewTicker(i * time.Millisecond) for { + v.log(LogDebug, "Sending heartbeat packet") err = wsConn.WriteJSON(voiceHeartbeatOp{3, int(time.Now().Unix())}) if err != nil { log.Println("wsHeartbeat send error: ", err) diff --git a/wsapi.go b/wsapi.go index 1c6abba..996ec91 100644 --- a/wsapi.go +++ b/wsapi.go @@ -377,6 +377,7 @@ func (s *Session) ChannelVoiceJoin(gID, cID string, mute, deaf bool) (voice *Voi data := voiceChannelJoinOp{4, voiceChannelJoinData{&gID, &cID, mute, deaf}} err = s.wsConn.WriteJSON(data) if err != nil { + s.log(LogInformational, "Deleting VoiceConnection %s", gID) delete(s.VoiceConnections, gID) return } @@ -385,6 +386,7 @@ func (s *Session) ChannelVoiceJoin(gID, cID string, mute, deaf bool) (voice *Voi err = voice.waitUntilConnected() if err != nil { voice.Close() + s.log(LogInformational, "Deleting VoiceConnection %s", gID) delete(s.VoiceConnections, gID) return }