less logging

This commit is contained in:
2023-12-04 14:09:00 +01:00
parent 8e0418791d
commit 65341fc6d2
4 changed files with 12 additions and 13 deletions

View File

@ -39,7 +39,7 @@ func storeMessage(filename string, item handler.MessageT) {
log.Printf("Unable to write message, message is not archived: %s", err)
return
}
log.Printf("Archiving message in file %s", filename)
log.Println("Successfully archived message")
}
func archiver() {
@ -79,9 +79,9 @@ func InputDispatcher() {
func handleMessage(message handler.MessageT) {
for _, mapping := range config.Config.TopicMappings {
log.Printf("Testing %s -> %s", mapping.Topics, mapping.Handler)
// log.Printf("Testing %s -> %s", mapping.Topics, mapping.Handler)
for _, subscribedTopic := range mapping.Topics {
log.Printf("Testing %s in %s", message.Topic, subscribedTopic)
// log.Printf("Testing %s in %s", message.Topic, subscribedTopic)
if mqtt.TopicMatchesSubscription(message.Topic, subscribedTopic) {
log.Printf("Handle message in handler %s", mapping.Handler)
handler, exists := handlerMap[mapping.Handler]
@ -89,11 +89,10 @@ func handleMessage(message handler.MessageT) {
handler.Handle(message)
return
} else {
log.Printf("Handler not found, message is lost")
log.Printf("Handler %s not found, message %s is lost", mapping.Handler, message)
}
} else {
log.Printf("no match")
}
}
}
log.Printf("No match for topic %s, message %s is lost", message.Topic, message)
}