mirror of
https://github.com/ehang-io/nps.git
synced 2025-08-31 17:56:56 +00:00
New functions
This commit is contained in:
@@ -21,7 +21,6 @@ var (
|
||||
logLevel = flag.String("log_level", "7", "log level 0~7")
|
||||
registerTime = flag.Int("time", 2, "register time long /h")
|
||||
)
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
if len(os.Args) > 2 {
|
||||
@@ -35,6 +34,8 @@ func main() {
|
||||
}
|
||||
}
|
||||
daemon.InitDaemon("npc", common.GetRunPath(), common.GetTmpPath())
|
||||
logs.EnableFuncCallDepth(true)
|
||||
logs.SetLogFuncCallDepth(3)
|
||||
if *logType == "stdout" {
|
||||
logs.SetLogger(logs.AdapterConsole, `{"level":`+*logLevel+`,"color":true}`)
|
||||
} else {
|
||||
|
@@ -13,6 +13,7 @@ import (
|
||||
_ "github.com/cnlh/nps/web/routers"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
@@ -36,10 +37,13 @@ func main() {
|
||||
return
|
||||
}
|
||||
}
|
||||
beego.LoadAppConfig("ini", filepath.Join(common.GetRunPath(), "conf", "nps.conf"))
|
||||
if level = beego.AppConfig.String("logLevel"); level == "" {
|
||||
level = "7"
|
||||
}
|
||||
logs.Reset()
|
||||
logs.EnableFuncCallDepth(true)
|
||||
logs.SetLogFuncCallDepth(3)
|
||||
if *logType == "stdout" {
|
||||
logs.SetLogger(logs.AdapterConsole, `{"level":`+level+`,"color":true}`)
|
||||
} else {
|
||||
@@ -53,6 +57,5 @@ func main() {
|
||||
logs.Error("Getting bridgePort error", err)
|
||||
os.Exit(0)
|
||||
}
|
||||
beego.LoadAppConfig("ini", filepath.Join(common.GetRunPath(), "conf", "app.conf"))
|
||||
server.StartNewServer(bridgePort, task, beego.AppConfig.String("bridgeType"))
|
||||
}
|
||||
|
Reference in New Issue
Block a user