logging lint (#170)

This commit is contained in:
Michael Quigley 2023-04-19 09:41:19 -04:00
parent 1177b0ec0a
commit e2193e3ac4
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 6 additions and 5 deletions

View File

@ -102,8 +102,6 @@ func (cmd *sharePrivateCommand) run(_ *cobra.Command, args []string) {
panic(err) panic(err)
} }
logrus.Infof("here")
auth := httptransport.APIKeyAuth("X-TOKEN", "header", zrd.Env.Token) auth := httptransport.APIKeyAuth("X-TOKEN", "header", zrd.Env.Token)
req := share.NewShareParams() req := share.NewShareParams()
req.Body = &rest_model_zrok.ShareRequest{ req.Body = &rest_model_zrok.ShareRequest{

View File

@ -2,14 +2,15 @@ package tcpTunnel
import ( import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"io"
"net" "net"
) )
const bufSz = 10240 const bufSz = 10240
func txer(from, to net.Conn) { func txer(from, to net.Conn) {
logrus.Infof("started '%v' -> '%v'", from.RemoteAddr(), to.RemoteAddr()) logrus.Debugf("started '%v' -> '%v'", from.RemoteAddr(), to.RemoteAddr())
defer logrus.Warnf("exited '%v' -> '%v'", from.RemoteAddr(), to.RemoteAddr()) defer logrus.Debugf("exited '%v' -> '%v'", from.RemoteAddr(), to.RemoteAddr())
buf := make([]byte, bufSz) buf := make([]byte, bufSz)
for { for {
@ -28,7 +29,9 @@ func txer(from, to net.Conn) {
return return
} }
} else { } else {
logrus.Errorf("read error '%v' -> '%v': %v", from.RemoteAddr(), to.RemoteAddr(), err) if err != io.EOF {
logrus.Errorf("read error '%v' -> '%v': %v", from.RemoteAddr(), to.RemoteAddr(), err)
}
_ = to.Close() _ = to.Close()
_ = from.Close() _ = from.Close()
return return