From d5572411076f6ead022ea381d2cadb3df11525d3 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Fri, 21 Jul 2023 14:40:24 +0100 Subject: [PATCH] Improve logging to determine if 'operator' is frequent enough not to mess up PIS lookup for VSTP services --- src/vstp/actions.go | 2 +- src/vstp/handler.go | 4 ++-- src/vstp/subscribe.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vstp/actions.go b/src/vstp/actions.go index 5dc023e..79759f2 100644 --- a/src/vstp/actions.go +++ b/src/vstp/actions.go @@ -18,7 +18,7 @@ func processEntryType(entry database.Service) { } func createEntry(entry database.Service) { - log.Msg.Info("Entry Creation requested for: " + entry.TrainUid + " - " + entry.Headcode) + log.Msg.Info("Entry Creation requested for: " + entry.TrainUid + " - " + entry.Headcode + " - " + entry.Operator) } func deleteEntry(entry database.Service) { diff --git a/src/vstp/handler.go b/src/vstp/handler.go index 0314184..e3c5ff0 100644 --- a/src/vstp/handler.go +++ b/src/vstp/handler.go @@ -15,7 +15,7 @@ var count uint64 = 0 func handle(msg *stomp.Message) { count++ - log.Msg.Info("Message count: " + fmt.Sprint(count)) + log.Msg.Info("Messages since started: " + fmt.Sprint(count)) schedule := unmarshalData(string(msg.Body)) processEntryType(schedule) saveToFile(schedule, "transformed") @@ -37,5 +37,5 @@ func saveToFile(msg any, suffix string) { return } - log.Msg.Info("Saved message to: " + path) + log.Msg.Debug("Saved message to: " + path) } diff --git a/src/vstp/subscribe.go b/src/vstp/subscribe.go index da1c687..e259209 100644 --- a/src/vstp/subscribe.go +++ b/src/vstp/subscribe.go @@ -29,7 +29,7 @@ func Subscribe() { if msg.Err != nil { log.Msg.Error("STOMP Message Error: " + msg.Err.Error()) } else { - log.Msg.Debug("STOMP Message Received") + log.Msg.Info("STOMP Message Received") saveToFile(string(msg.Body), "msgBody") handle(msg) }