Finish refining all the logger things.
This commit is contained in:
10
main.go
10
main.go
@ -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 {
|
||||
|
Reference in New Issue
Block a user