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"
|
||||
"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{}) {
|
||||
|
|
3
main.go
3
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)
|
||||
|
|
Loading…
Reference in New Issue