Finish refining all the logger things.

This commit is contained in:
zicla
2018-11-30 15:32:28 +08:00
parent 4af940647d
commit 6485e3b48e
19 changed files with 162 additions and 146 deletions

10
main.go
View File

@ -10,18 +10,22 @@ import (
func main() {
//日志第一优先级保障
rest.LOGGER.Init()
defer rest.LOGGER.Destroy()
//将运行时参数装填到config中去。
rest.PrepareConfigs()
//全局运行的上下文
rest.CONTEXT.Init()
defer rest.CONTEXT.Destroy()
http.Handle("/", rest.CONTEXT.Router)
dotPort := fmt.Sprintf(":%v", rest.CONFIG.ServerPort)
info := fmt.Sprintf("App started at http://localhost%v", dotPort)
rest.LogInfo(info)
rest.LOGGER.Info("App started at http://localhost:%v", rest.CONFIG.ServerPort)
err1 := http.ListenAndServe(dotPort, nil)
if err1 != nil {