Introduce #version
This commit is contained in:
parent
37aacf973b
commit
69497c77e4
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
|
4
main.go
4
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)
|
||||
|
|
Loading…
Reference in New Issue