From 4c35b0abc6fab90e21b151ef8d63731d09bfebe8 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Wed, 16 Jul 2014 03:11:10 +0700 Subject: [PATCH] Display configuration summary on startup --- logging.go | 11 +++++++++++ main.go | 3 --- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/logging.go b/logging.go index cdefcdd..3edb3cf 100644 --- a/logging.go +++ b/logging.go @@ -4,6 +4,7 @@ import ( "github.com/stvp/rollbar" "log" "os" + "runtime" ) var ( @@ -14,6 +15,16 @@ func SetupLogging() { logger = log.New(os.Stdout, "", log.Ldate|log.Lmicroseconds) rollbar.Token = Config.Rollbar rollbar.Environment = Config.Env + + Log("Burlesque started in %s environment", Config.Env) + Log("GOMAXPROCS is set to %d", runtime.GOMAXPROCS(-1)) + Log("Storage path: %s", Config.Storage) + Log("Server is running at http://127.0.0.1:%d", Config.Port) + if Config.Rollbar == "" { + Log("Rollbar is not configured and disabled") + } else { + Log("Rollbar token: %s", Config.Rollbar) + } } func Log(format string, args ...interface{}) { diff --git a/main.go b/main.go index d3b8c70..b1b007f 100644 --- a/main.go +++ b/main.go @@ -6,7 +6,6 @@ import ( "net/http" "os" "os/signal" - "runtime" "syscall" ) @@ -41,8 +40,6 @@ func main() { go KeepStatePersisted() go PersistMessages() - Log("GOMAXPROCS = %d", runtime.GOMAXPROCS(-1)) - Log("Starting HTTP server on port %d", Config.Port) port := fmt.Sprintf(":%d", Config.Port) http.ListenAndServe(port, nil)