commit 88af9da4a25c26169cadaee9256ce7539db17b19 Author: Shelikhoo xiaokangwang@outlook.com Date: Mon Dec 20 16:22:55 2021 +0000
Fix ProxyEventLogger output --- proxy/lib/pt_event_logger.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/proxy/lib/pt_event_logger.go b/proxy/lib/pt_event_logger.go index 5804614..6c4f4e9 100644 --- a/proxy/lib/pt_event_logger.go +++ b/proxy/lib/pt_event_logger.go @@ -9,7 +9,7 @@ import ( )
func NewProxyEventLogger(logPeriod time.Duration) event.SnowflakeEventReceiver { - el := &logEventLogger{} + el := &logEventLogger{logPeriod: logPeriod} el.task = &task.Periodic{Interval: logPeriod, Execute: el.logTick} el.task.Start() return el @@ -36,7 +36,7 @@ func (p *logEventLogger) OnNewSnowflakeEvent(e event.SnowflakeEvent) { func (p *logEventLogger) logTick() error { inbound, inboundUnit := formatTraffic(p.inboundSum) outbound, outboundUnit := formatTraffic(p.inboundSum) - fmt.Printf("In the last %v, there are %v connections. Traffic Relaied ↑ %v %v, ↓ %v %v.", + fmt.Printf("In the last %v, there are %v connections. Traffic Relaied ↑ %v %v, ↓ %v %v.\n", p.logPeriod.String(), p.connectionCount, inbound, inboundUnit, outbound, outboundUnit) p.outboundSum = 0 p.inboundSum = 0