From d225bb4bd2686aa7fa3504ed0c9a341734d45aa8 Mon Sep 17 00:00:00 2001 From: boyce Date: Tue, 25 Jun 2024 09:20:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=AF=E5=8A=A8=E5=8F=82?= =?UTF-8?q?=E6=95=B0logchannelcap=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- node/node.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/node/node.go b/node/node.go index 21ad322..d1ba6e8 100644 --- a/node/node.go +++ b/node/node.go @@ -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) } @@ -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 }