Skip to content

Commit

Permalink
feat: Add logging for successfully handling message
Browse files Browse the repository at this point in the history
  • Loading branch information
imulab committed Oct 31, 2023
1 parent 5c46a37 commit bf101f2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/listener/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ func newMqttClient(c *config, logger *zerolog.Logger, subscribers []wt.Subscribe
router.RegisterHandler(s.Option().Topic, func(p *paho.Publish) {
if handleErr := s.Handle(p); handleErr != nil {
logger.Err(handleErr).Str("topic", p.Topic).Msg("failed to handle message")
return
}

logger.Info().Str("topic", p.Topic).Msg("handled message")
})
}

Expand Down

0 comments on commit bf101f2

Please sign in to comment.