1
0
Fork 0

Display configuration summary on startup

This commit is contained in:
Gregory Eremin 2014-07-16 03:11:10 +07:00
parent 4ba77f6631
commit 4c35b0abc6
2 changed files with 11 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import (
"github.com/stvp/rollbar" "github.com/stvp/rollbar"
"log" "log"
"os" "os"
"runtime"
) )
var ( var (
@ -14,6 +15,16 @@ func SetupLogging() {
logger = log.New(os.Stdout, "", log.Ldate|log.Lmicroseconds) logger = log.New(os.Stdout, "", log.Ldate|log.Lmicroseconds)
rollbar.Token = Config.Rollbar rollbar.Token = Config.Rollbar
rollbar.Environment = Config.Env 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{}) { func Log(format string, args ...interface{}) {

View File

@ -6,7 +6,6 @@ import (
"net/http" "net/http"
"os" "os"
"os/signal" "os/signal"
"runtime"
"syscall" "syscall"
) )
@ -41,8 +40,6 @@ func main() {
go KeepStatePersisted() go KeepStatePersisted()
go PersistMessages() go PersistMessages()
Log("GOMAXPROCS = %d", runtime.GOMAXPROCS(-1))
Log("Starting HTTP server on port %d", Config.Port)
port := fmt.Sprintf(":%d", Config.Port) port := fmt.Sprintf(":%d", Config.Port)
http.ListenAndServe(port, nil) http.ListenAndServe(port, nil)