Loop: catch reconnection errors; writeLoop: only log.Print if Debug

This commit is contained in:
joe
2013-09-25 23:37:11 -04:00
parent 14b5cb8b16
commit c10849b4c0
3 changed files with 15 additions and 3 deletions

View File

@@ -115,7 +115,9 @@ func (irc *Connection) setupCallbacks() {
irc.AddCallback("PONG", func(e *Event) {
ns, _ := strconv.ParseInt(e.Message, 10, 64)
delta := time.Duration(time.Now().UnixNano() - ns)
irc.log.Printf("Lag: %vs\n", delta)
if irc.Debug {
irc.log.Printf("Lag: %vs\n", delta)
}
})
irc.AddCallback("NICK", func(e *Event) {