From d69f971519e90a0a3a9b3f911d3e72d7a18f274c Mon Sep 17 00:00:00 2001 From: esrrhs Date: Sun, 27 Oct 2019 19:41:56 +0800 Subject: [PATCH] add --- cmd/main.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmd/main.go b/cmd/main.go index 453f489..c05281c 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -50,6 +50,10 @@ Usage: -tcp_gz 当数据包超过这个大小,tcp将压缩数据,0表示不压缩,默认0 Tcp will compress data when the packet exceeds this size, 0 means no compression, default 0 + + -nolog 不写日志文件,只打印标准输出,默认0 + Do not write log files, only print standard output, default 0 is off + ` func main() { @@ -65,6 +69,7 @@ func main() { tcpmode_maxwin := flag.Int("tcp_mw", 10000, "tcp mode max win") tcpmode_resend_timems := flag.Int("tcp_rst", 400, "tcp mode resend time ms") tcpmode_compress := flag.Int("tcp_gz", 0, "tcp data compress") + nolog := flag.Int("nolog", 0, "write log file") flag.Usage = func() { fmt.Printf(usage) } @@ -80,7 +85,12 @@ func main() { return } - loggo.Ini(loggo.Config{Level: loggo.LEVEL_INFO, Prefix: "pingtunnel", MaxDay: 3}) + loggo.Ini(loggo.Config{ + Level: loggo.LEVEL_INFO, + Prefix: "pingtunnel", + MaxDay: 3, + NoLogFile: *nolog > 0, + }) loggo.Info("start...") loggo.Info("key %d", *key)