Improved logging
This commit is contained in:
		@@ -50,6 +50,7 @@ func NewClient(logger *zap.Logger, config *config.Config, csvHelper *csv.Helper)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func StartListening(logger *zap.Logger, config *config.Config, client mqtt.Client) {
 | 
					func StartListening(logger *zap.Logger, config *config.Config, client mqtt.Client) {
 | 
				
			||||||
 | 
						logger.Info("Subscribing to", zap.Int("topics", len(config.Topics)))
 | 
				
			||||||
	for _, topic := range config.Topics {
 | 
						for _, topic := range config.Topics {
 | 
				
			||||||
		if token := client.Subscribe(topic, 0, nil); token.Wait() && token.Error() != nil {
 | 
							if token := client.Subscribe(topic, 0, nil); token.Wait() && token.Error() != nil {
 | 
				
			||||||
			logger.Error("error subscribing to topic", zap.String("topic", topic), zap.Error(token.Error()))
 | 
								logger.Error("error subscribing to topic", zap.String("topic", topic), zap.Error(token.Error()))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user