Add more irc debug on connect (when debugging enabled)

This commit is contained in:
Wim 2016-10-01 20:07:59 +02:00
parent 1accee1653
commit e52b040b9c

View File

@ -52,6 +52,9 @@ func (b *Birc) Command(msg *config.Message) string {
func (b *Birc) Connect() error { func (b *Birc) Connect() error {
flog.Infof("Connecting %s", b.Config.Server) flog.Infof("Connecting %s", b.Config.Server)
i := irc.IRC(b.Config.Nick, b.Config.Nick) i := irc.IRC(b.Config.Nick, b.Config.Nick)
if log.GetLevel() == log.DebugLevel {
i.Debug = true
}
i.UseTLS = b.Config.UseTLS i.UseTLS = b.Config.UseTLS
i.UseSASL = b.Config.UseSASL i.UseSASL = b.Config.UseSASL
i.SASLLogin = b.Config.NickServNick i.SASLLogin = b.Config.NickServNick
@ -66,6 +69,7 @@ func (b *Birc) Connect() error {
return err return err
} }
flog.Info("Connection succeeded") flog.Info("Connection succeeded")
i.Debug = false
b.i = i b.i = i
return nil return nil
} }