From 7018e3693bfc545342922e16e6051ac36857b9bd Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 28 Oct 2018 15:44:13 -0400 Subject: [PATCH] optimization: check IsLoggingRawIO before attempting to log input --- irc/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/irc/client.go b/irc/client.go index af91f03e..a4f76339 100644 --- a/irc/client.go +++ b/irc/client.go @@ -315,7 +315,9 @@ func (client *Client) run() { break } - client.server.logger.Debug("userinput", client.nick, "<- ", line) + if client.server.logger.IsLoggingRawIO() { + client.server.logger.Debug("userinput", client.nick, "<- ", line) + } // special-cased handling of PROXY protocol, see `handleProxyCommand` for details: if firstLine {