From f997fc841af44d45f3d7037e20abddd436618315 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sat, 4 Oct 2014 08:20:58 -0400 Subject: [PATCH] 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. --- irc.go | 3 +++ irc_struct.go | 1 + 2 files changed, 4 insertions(+) diff --git a/irc.go b/irc.go index 1ee1405..2aa6c40 100644 --- a/irc.go +++ b/irc.go @@ -97,6 +97,9 @@ func (irc *Connection) readLoop() { } /* XXX: len(args) == 0: args should be empty */ + if irc.VerboseReadLoop { + irc.Log.Println(event.Raw) + } irc.RunCallbacks(event) } diff --git a/irc_struct.go b/irc_struct.go index 161c6a2..6f7a259 100644 --- a/irc_struct.go +++ b/irc_struct.go @@ -38,6 +38,7 @@ type Connection struct { lastMessage time.Time VerboseCallbackHandler bool + VerboseReadLoop bool Log *log.Logger stopped bool