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))
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 {

View File

@ -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