Display configuration summary on startup
This commit is contained in:
parent
4ba77f6631
commit
4c35b0abc6
11
logging.go
11
logging.go
|
@ -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{}) {
|
||||||
|
|
3
main.go
3
main.go
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue