Only log unhandled messages in debug mode

This commit is contained in:
Eric Mertens 2023-09-21 17:16:03 -07:00 committed by Simon Ser
parent fe64c795cd
commit 60b041419a
2 changed files with 4 additions and 4 deletions

View file

@ -752,7 +752,7 @@ func (dc *downstreamConn) handleMessageUnregistered(ctx context.Context, msg *ir
dc.SendMessage(ctx, generateAwayReply(dc.away != nil)) dc.SendMessage(ctx, generateAwayReply(dc.away != nil))
default: default:
dc.logger.Printf("unhandled message: %v", msg) dc.logger.Debugf("unhandled message: %v", msg)
return newUnknownCommandError(msg.Command) return newUnknownCommandError(msg.Command)
} }
return nil return nil
@ -3318,7 +3318,7 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc.
}} }}
} }
default: default:
dc.logger.Printf("unhandled message: %v", msg) dc.logger.Debugf("unhandled message: %v", msg)
// Only forward unknown commands in single-upstream mode // Only forward unknown commands in single-upstream mode
if dc.network == nil { if dc.network == nil {

View file

@ -763,7 +763,7 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err
}) })
} }
default: default:
uc.logger.Printf("unhandled message: %v", msg) uc.logger.Debugf("unhandled message: %v", msg)
} }
case "AUTHENTICATE": case "AUTHENTICATE":
if uc.saslClient == nil { if uc.saslClient == nil {
@ -1819,7 +1819,7 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err
} }
uc.forwardMsgByID(ctx, downstreamID, msg) uc.forwardMsgByID(ctx, downstreamID, msg)
default: default:
uc.logger.Printf("unhandled message: %v", msg) uc.logger.Debugf("unhandled message: %v", msg)
uc.forwardMsgByID(ctx, downstreamID, msg) uc.forwardMsgByID(ctx, downstreamID, msg)
} }
return nil return nil