diff --git a/logging.go b/logging.go index 8a3dd77..58c0add 100644 --- a/logging.go +++ b/logging.go @@ -13,14 +13,14 @@ var ( func SetupLogging() { logger = log.New(os.Stdout, "", log.Ldate|log.Lmicroseconds) - Log("Burlesque started in %s environment", Config.Env) + Log("Burlesque v%s started in %s environment", Version, 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) } func Log(format string, args ...interface{}) { - logger.Printf("[INFO] "+format, args...) + logger.Printf("[INFO] "+format, args...) } func Debug(format string, args ...interface{}) { @@ -35,6 +35,6 @@ func Error(err error, format string, args ...interface{}) { if Config.Env == "development" { panic(err) } else { - logger.Printf(" ", err.Error()) + logger.Printf(" ", err.Error()) } } diff --git a/main.go b/main.go index e2a1b19..09d36d7 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,10 @@ import ( "syscall" ) +const ( + Version = "0.1.3" +) + func HandleShutdown() { ch := make(chan os.Signal) signal.Notify(ch, os.Interrupt, os.Kill, syscall.SIGTERM, syscall.SIGINT) diff --git a/server.go b/server.go index 7584ce6..ea17f7e 100644 --- a/server.go +++ b/server.go @@ -30,6 +30,7 @@ func StatusHandler(w http.ResponseWriter, r *http.Request) { func DebugHandler(w http.ResponseWriter, r *http.Request) { info := make(map[string]interface{}) + info["version"] = Version info["goroutines"] = runtime.NumGoroutine() s, err := storage.Status()