fix(irc): log only validated messages (#954)

* fix(irc): flip spam to trace

* Update handler.go
This commit is contained in:
Kyle Sanderson 2023-05-24 04:00:35 -07:00 committed by GitHub
parent b1eae6e980
commit 5a61b406b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -562,8 +562,6 @@ func (h *Handler) onMessage(msg ircmsg.Message) {
// clean message
cleanedMsg := h.cleanMessage(message)
h.log.Debug().Str("channel", channel).Str("nick", nick).Msg(cleanedMsg)
// publish to SSE stream
h.publishSSEMsg(domain.IrcMessage{Channel: channel, Nick: nick, Message: cleanedMsg, Time: time.Now()})
@ -577,6 +575,8 @@ func (h *Handler) onMessage(msg ircmsg.Message) {
return
}
h.log.Debug().Str("channel", channel).Str("nick", nick).Msg(cleanedMsg)
if err := h.sendToAnnounceProcessor(channel, cleanedMsg); err != nil {
h.log.Error().Stack().Err(err).Msgf("could not queue line: %v", cleanedMsg)
return