diff options
author | Shelikhoo <xiaokangwang@outlook.com> | 2022-01-28 14:46:45 +0000 |
---|---|---|
committer | Shelikhoo <xiaokangwang@outlook.com> | 2022-01-28 14:46:45 +0000 |
commit | e828b0607662c7325f4d1bbf4c5072ce81f38fb9 (patch) | |
tree | 580e809cac476d98f57896e9006d90f36d187b74 | |
parent | bf3bd635f71fd5faae1ebaa05d5987cfa464b30b (diff) | |
download | snowflake-e828b0607662c7325f4d1bbf4c5072ce81f38fb9.tar.gz snowflake-e828b0607662c7325f4d1bbf4c5072ce81f38fb9.zip |
Use log instead of fmt in proxy event logger
See also:
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/72#note_2772839
-rw-r--r-- | proxy/lib/pt_event_logger.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/proxy/lib/pt_event_logger.go b/proxy/lib/pt_event_logger.go index f6552c8..b0dbf60 100644 --- a/proxy/lib/pt_event_logger.go +++ b/proxy/lib/pt_event_logger.go @@ -1,8 +1,8 @@ package snowflake_proxy import ( - "fmt" "git.torproject.org/pluggable-transports/snowflake.git/v2/common/task" + "log" "time" "git.torproject.org/pluggable-transports/snowflake.git/v2/common/event" @@ -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 Relayed ↑ %v %v, ↓ %v %v.\n", + log.Printf("In the last %v, there are %v connections. Traffic Relayed ↑ %v %v, ↓ %v %v.\n", p.logPeriod.String(), p.connectionCount, inbound, inboundUnit, outbound, outboundUnit) p.outboundSum = 0 p.inboundSum = 0 |