Skip to content

Commit 6c27fa6

Browse files
committed
fix log
1 parent 600c3d0 commit 6c27fa6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmd/root.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func runAction(cmd *cobra.Command, args []string) error {
8282
case SIGUSR1:
8383
mem := runtime.MemStats{}
8484
runtime.ReadMemStats(&mem)
85-
logrus.Info("stats:\n"+
85+
logrus.Infof("stats:\n"+
8686
" %s, uptime: %s\n"+
8787
" goroutines: %d, mem-alloc: %d\n"+
8888
" connections open: %d total: %d",
@@ -97,11 +97,11 @@ func runAction(cmd *cobra.Command, args []string) error {
9797
}
9898
}()
9999
//accept connections
100-
logrus.Info("listening on " + source + " and forwarding to " + destination)
100+
logrus.Infof("listening on %s and forwarding to %s", source, destination)
101101
for {
102102
uconn, err := l.Accept()
103103
if err != nil {
104-
logrus.Info("accept failed: %s", err)
104+
logrus.Infof("accept failed: %s", err)
105105
continue
106106
}
107107
go fwd(uconn, destination, quiet)
@@ -141,7 +141,7 @@ func fwd(uconn net.Conn, destination string, quiet bool) {
141141
atomic.AddInt64(&current, 1)
142142
//optional log
143143
if !quiet {
144-
logrus.Info("connection #%d (%d open)", atomic.LoadUint64(&total), atomic.LoadInt64(&current))
144+
logrus.Infof("connection #%d (%d open)", atomic.LoadUint64(&total), atomic.LoadInt64(&current))
145145
}
146146
//pipe!
147147
go func() {

0 commit comments

Comments
 (0)