Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
consumer debug
Browse files Browse the repository at this point in the history
  • Loading branch information
laullon committed Jun 3, 2019
1 parent 4dfb4a4 commit 9779a92
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func main() {
noaaConsumer := consumer.New(trafficControllerURL, &tls.Config{
InsecureSkipVerify: conf.Nozzle.SkipSSL,
}, nil)
noaaConsumer.SetDebugPrinter(loggerDebugPrinter{})
events, errs := noaaConsumer.Firehose(strings.Trim(conf.Nozzle.FirehoseSubscriptionID, " "), token)

wavefront := nozzle.CreateEventHandler(conf.Wavefront)
Expand All @@ -57,3 +58,10 @@ func main() {
logger.Fatal("[ERROR] Error forwarding", err)
}
}

type loggerDebugPrinter struct {
}

func (loggerDebugPrinter) Print(title, body string) {
logger.Printf("[%s] %s", title, body)
}
2 changes: 1 addition & 1 deletion nozzle/nozzle.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ func (s *forwardingNozzle) handleEvent(envelope *events.Envelope) {

func (s *forwardingNozzle) handleError(err error) {
logger.Printf("Error from firehose - %v", err)
logger.Fatal("Forcing restart")
// logger.Fatal("Forcing restart")
}

0 comments on commit 9779a92

Please sign in to comment.