Add a 'VerboseReadLoop' option.
Troubleshooting responses from the IRC server becomes easier when you can actually see the raw responses. This change adds a 'VerboseReadLoop' member to the Connection struct. When set to true, the raw messages sent from the server will be placed into the standard log for review. This message is printed before evaluating any callbacks.
This commit is contained in:
parent
066134263e
commit
f997fc841a
3
irc.go
3
irc.go
@ -97,6 +97,9 @@ func (irc *Connection) readLoop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* XXX: len(args) == 0: args should be empty */
|
/* XXX: len(args) == 0: args should be empty */
|
||||||
|
if irc.VerboseReadLoop {
|
||||||
|
irc.Log.Println(event.Raw)
|
||||||
|
}
|
||||||
|
|
||||||
irc.RunCallbacks(event)
|
irc.RunCallbacks(event)
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ type Connection struct {
|
|||||||
lastMessage time.Time
|
lastMessage time.Time
|
||||||
|
|
||||||
VerboseCallbackHandler bool
|
VerboseCallbackHandler bool
|
||||||
|
VerboseReadLoop bool
|
||||||
Log *log.Logger
|
Log *log.Logger
|
||||||
|
|
||||||
stopped bool
|
stopped bool
|
||||||
|
Loading…
Reference in New Issue
Block a user