上传cmd 日志开关
This commit is contained in:
parent
7efd39ba8b
commit
f32f10292f
@ -29,7 +29,7 @@ var (
|
|||||||
gmpath string //服务列表下标
|
gmpath string //服务列表下标
|
||||||
crosspath string //服务列表下标
|
crosspath string //服务列表下标
|
||||||
sid string //服务列表下标
|
sid string //服务列表下标
|
||||||
onelog bool //日志路径
|
openlog bool //日志路径
|
||||||
)
|
)
|
||||||
var confCmd = &cobra.Command{
|
var confCmd = &cobra.Command{
|
||||||
Use: "conf",
|
Use: "conf",
|
||||||
@ -79,7 +79,7 @@ func init() {
|
|||||||
RootCmd.PersistentFlags().StringVarP(&gmpath, "gm", "g", "./gm.json", "游戏区服配置")
|
RootCmd.PersistentFlags().StringVarP(&gmpath, "gm", "g", "./gm.json", "游戏区服配置")
|
||||||
RootCmd.PersistentFlags().StringVarP(&crosspath, "cross", "c", "./cross.json", "游戏跨服配置")
|
RootCmd.PersistentFlags().StringVarP(&crosspath, "cross", "c", "./cross.json", "游戏跨服配置")
|
||||||
RootCmd.PersistentFlags().StringVarP(&sid, "sid", "i", "", "区服id")
|
RootCmd.PersistentFlags().StringVarP(&sid, "sid", "i", "", "区服id")
|
||||||
RootCmd.PersistentFlags().BoolVarP(&onelog, "log", "l", false, "输出日志")
|
RootCmd.PersistentFlags().BoolVarP(&openlog, "log", "l", false, "输出日志")
|
||||||
RootCmd.AddCommand(confCmd, startCmd, stopCmd, restart)
|
RootCmd.AddCommand(confCmd, startCmd, stopCmd, restart)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,7 +340,7 @@ func convertServiceSttings(config *comm.GameConfig, id int, stype string, ip str
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !onelog {
|
if openlog {
|
||||||
sseting.Sys["rpcx"]["Debug"] = true
|
sseting.Sys["rpcx"]["Debug"] = true
|
||||||
sseting.Sys["log"] = map[string]interface{}{
|
sseting.Sys["log"] = map[string]interface{}{
|
||||||
"FileName": fmt.Sprintf("./log/%s.log", sseting.Id),
|
"FileName": fmt.Sprintf("./log/%s.log", sseting.Id),
|
||||||
@ -351,7 +351,7 @@ func convertServiceSttings(config *comm.GameConfig, id int, stype string, ip str
|
|||||||
} else {
|
} else {
|
||||||
sseting.Sys["log"] = map[string]interface{}{
|
sseting.Sys["log"] = map[string]interface{}{
|
||||||
"Alias": sseting.Id,
|
"Alias": sseting.Id,
|
||||||
"FileName": "./s.log",
|
"FileName": fmt.Sprintf("./log/%s.log", sseting.Id),
|
||||||
"IsDebug": false,
|
"IsDebug": false,
|
||||||
"Loglevel": log.ErrorLevel,
|
"Loglevel": log.ErrorLevel,
|
||||||
"MaxAgeTime": 7,
|
"MaxAgeTime": 7,
|
||||||
|
Loading…
Reference in New Issue
Block a user