Skip to content

Commit

Permalink
优化启动参数logchannelcap默认值
Browse files Browse the repository at this point in the history
  • Loading branch information
boyce committed Jun 25, 2024
1 parent ea37fb5 commit d225bb4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func init() {
console.RegisterCommandString("loglevel", "debug", "<-loglevel debug|release|warning|error|fatal> Set loglevel.", setLevel)
console.RegisterCommandString("logpath", "", "<-logpath path> Set log file path.", setLogPath)
console.RegisterCommandInt("logsize", 0, "<-logsize size> Set log size(MB).", setLogSize)
console.RegisterCommandInt("logchannelcap", 0, "<-logchannelcap num> Set log channel cap.", setLogChannelCapNum)
console.RegisterCommandInt("logchannelcap", -1, "<-logchannelcap num> Set log channel cap.", setLogChannelCapNum)
console.RegisterCommandString("pprof", "", "<-pprof ip:port> Open performance analysis.", setPprof)
}

Expand Down Expand Up @@ -506,6 +506,10 @@ func setLogChannelCapNum(args interface{}) error {
return errors.New("param logsize is error")
}

if logChannelCap == -1 {
return nil
}

log.LogChannelCap = logChannelCap
return nil
}

0 comments on commit d225bb4

Please sign in to comment.