From 60b041419a231d6d9259a245410ab59de58c73c2 Mon Sep 17 00:00:00 2001 From: Eric Mertens Date: Thu, 21 Sep 2023 17:16:03 -0700 Subject: [PATCH] Only log unhandled messages in debug mode --- downstream.go | 4 ++-- upstream.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/downstream.go b/downstream.go index 4b9f72e..51d3115 100644 --- a/downstream.go +++ b/downstream.go @@ -752,7 +752,7 @@ func (dc *downstreamConn) handleMessageUnregistered(ctx context.Context, msg *ir dc.SendMessage(ctx, generateAwayReply(dc.away != nil)) default: - dc.logger.Printf("unhandled message: %v", msg) + dc.logger.Debugf("unhandled message: %v", msg) return newUnknownCommandError(msg.Command) } return nil @@ -3318,7 +3318,7 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc. }} } default: - dc.logger.Printf("unhandled message: %v", msg) + dc.logger.Debugf("unhandled message: %v", msg) // Only forward unknown commands in single-upstream mode if dc.network == nil { diff --git a/upstream.go b/upstream.go index 979bb60..80f0517 100644 --- a/upstream.go +++ b/upstream.go @@ -763,7 +763,7 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err }) } default: - uc.logger.Printf("unhandled message: %v", msg) + uc.logger.Debugf("unhandled message: %v", msg) } case "AUTHENTICATE": if uc.saslClient == nil { @@ -1819,7 +1819,7 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err } uc.forwardMsgByID(ctx, downstreamID, msg) default: - uc.logger.Printf("unhandled message: %v", msg) + uc.logger.Debugf("unhandled message: %v", msg) uc.forwardMsgByID(ctx, downstreamID, msg) } return nil