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"
"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{}) {

View File

@ -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)