Skip to content

Commit

Permalink
ipn/proxies: m verbose log
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Nov 12, 2024
1 parent 1ee1bff commit debf74d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions intra/ipn/proxies.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func (px *proxifier) RemoveProxy(id string) bool {
// ProxyTo implements Proxies.
// May return both a Proxy and an error, in which case, the error
// denotes that while the Proxy is not healthy, it is still registered.
func (px *proxifier) ProxyTo(ipp netip.AddrPort, uid string, pids []string) (Proxy, error) {
func (px *proxifier) ProxyTo(ipp netip.AddrPort, uid string, pids []string) (_ Proxy, err error) {
if len(pids) <= 0 || firstEmpty(pids) {
return nil, errMissingProxyID
}
Expand Down Expand Up @@ -344,6 +344,11 @@ func (px *proxifier) ProxyTo(ipp netip.AddrPort, uid string, pids []string) (Pro
loproxies = append(loproxies, lopinned)
}

defer func() {
logev(err)("proxy: pin: %s+%s; miss: %v; notok: %v; noroute: %v; ended %v",
uid, ipp, missproxies, notokproxies, norouteproxies, endproxies)
}()

for _, pid := range pids {
if pid == pinnedpid { // already tried above
continue
Expand Down Expand Up @@ -391,8 +396,6 @@ func (px *proxifier) ProxyTo(ipp netip.AddrPort, uid string, pids []string) (Pro
missproxies = append(missproxies, pid)
}

log.VV("proxy: pin: %s+%s; miss: %v; notok: %v; noroute: %v; ended %v",
uid, ipp, missproxies, notokproxies, norouteproxies, endproxies)
return nil, errProxyAllDown
}

Expand Down
2 changes: 1 addition & 1 deletion intra/ipn/wgproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -1184,5 +1184,5 @@ func logev(err error) log.LogFn {
if err != nil {
return log.E
}
return log.V
return log.VV
}

0 comments on commit debf74d

Please sign in to comment.