Fix web and public-api log info messages. (#129)

The existing startup/shutdown log info messages had spacing issues and
used fmt.

Update the log messages to use logrus for consistency, and fix spacing
issues.

Signed-off-by: Andrew Seigner <andrew@sig.gy>
This commit is contained in:
Andrew Seigner 2018-01-09 16:14:56 -08:00 committed by GitHub
parent 2b22d4bc63
commit 1ceaf3874a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -3,7 +3,6 @@ package main
import (
"context"
"flag"
"fmt"
"net/http"
"os"
"os/signal"
@ -11,10 +10,10 @@ import (
log "github.com/sirupsen/logrus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/runconduit/conduit/controller/api/public"
"github.com/runconduit/conduit/controller/tap"
"github.com/runconduit/conduit/controller/telemetry"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
func main() {
@ -42,18 +41,18 @@ func main() {
server := public.NewServer(*addr, telemetryClient, tapClient)
go func() {
fmt.Println("starting HTTP server on", *addr)
log.Infof("starting HTTP server on %+v", *addr)
server.ListenAndServe()
}()
go func() {
fmt.Println("serving scrapable metrics on", *metricsAddr)
log.Infof("serving scrapable metrics on %+v", *metricsAddr)
http.Handle("/metrics", promhttp.Handler())
http.ListenAndServe(*metricsAddr, nil)
}()
<-stop
fmt.Println("shutting down HTTP server on", *addr)
log.Infof("shutting down HTTP server on %+v", *addr)
server.Shutdown(context.Background())
}

View File

@ -51,19 +51,19 @@ func main() {
server := srv.NewServer(*addr, *templateDir, *staticDir, *uuid, *webpackDevServer, *reload, client)
go func() {
log.Info("starting HTTP server on", *addr)
log.Infof("starting HTTP server on %+v", *addr)
server.ListenAndServe()
}()
go func() {
log.Info("serving scrapable metrics on", *metricsAddr)
log.Infof("serving scrapable metrics on %+v", *metricsAddr)
http.Handle("/metrics", promhttp.Handler())
http.ListenAndServe(*metricsAddr, nil)
}()
<-stop
log.Info("shutting down HTTP server on", *addr)
log.Infof("shutting down HTTP server on %+v", *addr)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
server.Shutdown(ctx)