Skip to content

Commit

Permalink
fixes logs showing pointers (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
z-cran authored Oct 13, 2022
1 parent 6c512a6 commit 879d2a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ func main() {
}

if *notificationsTopic != "" {
logger.Info("Configuring Topic: %s", notificationsTopic)
logger.Info("Configuring Topic: %s", *notificationsTopic)
if *acksTopic != "" {
logger.Info("Configuring Topic: %s", acksTopic)
logger.Info("Configuring Topic: %s", *acksTopic)
}
notificationsCh = make(chan protos.EventResponse)
defer close(notificationsCh)
Expand Down
6 changes: 3 additions & 3 deletions pubsub/sqs_pub.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/golang/protobuf/proto"
log "github.com/massenz/slf4go/logging"
protos "github.com/massenz/statemachine-proto/golang/api"
"strconv"
)

// NewSqsPublisher will create a new `Publisher` to send error notifications received on the
Expand Down Expand Up @@ -61,15 +62,14 @@ func GetQueueUrl(client *sqs.SQS, topic string) string {
// else, all outcomes will be sent to the errorsTopic. If notifyErrorsOnly is true, only error outcomes
// will be sent.
func (s *SqsPublisher) Publish(errorsTopic string, acksTopic string, notifyErrorsOnly bool) {
s.logger.Info("SQS Publisher started for topics: %s %s", errorsTopic, acksTopic)
s.logger.Info("SQS Publisher notifyErrorsOnly: %s", notifyErrorsOnly)

errorsQueueUrl := GetQueueUrl(s.client, errorsTopic)
var acksQueueUrl string
if acksTopic != "" {
acksQueueUrl = GetQueueUrl(s.client, acksTopic)
}
delay := int64(0)
s.logger.Info("SQS Publisher started for topics: %s %s", errorsQueueUrl, acksQueueUrl)
s.logger.Info("SQS Publisher notifyErrorsOnly: %s", strconv.FormatBool(notifyErrorsOnly))
for eventResponse := range s.notifications {
isOKOutcome := eventResponse.Outcome != nil && eventResponse.Outcome.Code == protos.EventOutcome_Ok
if isOKOutcome && notifyErrorsOnly {
Expand Down

0 comments on commit 879d2a3

Please sign in to comment.