Skip to content

Commit 763db8f

Browse files
committed
Use rubberneck on startup
1 parent 9c032b7 commit 763db8f

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

main.go

+3-12
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
log "github.com/Sirupsen/logrus"
1717
"github.com/armon/go-metrics"
1818
"github.com/relistan/go-director"
19+
"gopkg.in/relistan/rubberneck.v1"
1920
)
2021

2122
var (
@@ -244,18 +245,8 @@ func main() {
244245
exitWithError(err, "Failed to find private IP address")
245246
mlConfig.AdvertiseAddr = publishedIP
246247

247-
log.Println("Sidecar starting -------------------")
248-
log.Printf("Cluster Name: %s", *opts.ClusterName)
249-
log.Printf("Config File: %s", *opts.ConfigFile)
250-
log.Printf("Cluster Seeds: %s", strings.Join(*opts.ClusterIPs, ", "))
251-
log.Printf("Advertised address: %s", publishedIP)
252-
log.Printf("Service Name Match: %s", config.Services.NameMatch)
253-
log.Printf("Excluded IPs: %v", config.Sidecar.ExcludeIPs)
254-
log.Printf("Push/Pull Interval: %s", config.Sidecar.PushPullInterval.Duration.String())
255-
log.Printf("Gossip Messages: %d", config.Sidecar.GossipMessages)
256-
log.Printf("Logging level: %s", config.Sidecar.LoggingLevel)
257-
log.Printf("Running HAproxy: %t", !config.HAproxy.Disable && !*opts.HAproxyDisable)
258-
log.Println("----------------------------------")
248+
printer := rubberneck.NewPrinter(log.Infof, rubberneck.NoAddLineFeed)
249+
printer.PrintWithLabel("Sidecar starting", *opts, config)
259250

260251
list, err := memberlist.Create(mlConfig)
261252
exitWithError(err, "Failed to create memberlist")

0 commit comments

Comments
 (0)