more fine-grained log level

This commit is contained in:
ginuerzh
2022-08-18 11:34:57 +08:00
parent 052b8e9468
commit f3f3acd4e1
57 changed files with 262 additions and 242 deletions

View File

@ -21,7 +21,7 @@ func (c *socks5Connector) Bind(ctx context.Context, conn net.Conn, network, addr
"network": network,
"address": address,
})
log.Infof("bind on %s/%s", address, network)
log.Debugf("bind on %s/%s", address, network)
options := connector.BindOptions{}
for _, opt := range opts {
@ -98,18 +98,17 @@ func (l *socks5Connector) bind(conn net.Conn, cmd uint8, network, address string
addr := gosocks5.Addr{}
addr.ParseFrom(address)
req := gosocks5.NewRequest(cmd, &addr)
log.Trace(req)
if err := req.Write(conn); err != nil {
return nil, err
}
log.Debug(req)
// first reply, bind status
reply, err := gosocks5.ReadReply(conn)
if err != nil {
return nil, err
}
log.Debug(reply)
log.Trace(reply)
if reply.Rep != gosocks5.Succeeded {
return nil, fmt.Errorf("bind on %s/%s failed", address, network)