log: show caller's info in verbose mode

This commit is contained in:
nadoo committed 2019-10-20 17:52:25 +08:00
1 parent ef8cdfa703
commit 486c455236
6 files changed
+23 -4

No files matched your search

+5 -1
View File
@@ -1,6 +1,7 @@
package tcptun
import (
"errors"
"net"
"net/url"
"strings"
@@ -26,12 +27,15 @@ func init() {
func NewTCPTun(s string, p proxy.Proxy) (*TCPTun, error) {
u, err := url.Parse(s)
if err != nil {
log.F("parse err: %s", err)
log.F("[tcptun] parse err: %s", err)
return nil, err
}
addr := u.Host
d := strings.Split(addr, "=")
if len(d) < 2 {
return nil, errors.New("error in strings.Split")
}
t := &TCPTun{
proxy: p,