diff --git a/core/src/main/golang/bridge/proxies.go b/core/src/main/golang/bridge/proxies.go index b0a5d57..0d1b729 100644 --- a/core/src/main/golang/bridge/proxies.go +++ b/core/src/main/golang/bridge/proxies.go @@ -106,20 +106,24 @@ func QueryAllProxyGroups(collection ProxyGroupCollection) { func SetSelectedProxy(name, proxy string) bool { p := tunnel.Proxies()[name] if p == nil { + log.Infoln("Set %s: Not such proxy group", name) return false } pb, ok := p.(*outbound.Proxy) if !ok { + log.Infoln("Set %s: Not a proxy object", name) return false } selector, ok := pb.ProxyAdapter.(*outboundgroup.Selector) if !ok { + log.Infoln("Set %s: Not a selector group", name) return false } if err := selector.Set(proxy); err != nil { + log.Infoln("Set %s: %s", name, err.Error()) return false } diff --git a/core/src/main/golang/tun/log.go b/core/src/main/golang/tun/log.go index 6a750e8..7eafb1b 100644 --- a/core/src/main/golang/tun/log.go +++ b/core/src/main/golang/tun/log.go @@ -5,17 +5,17 @@ import "github.com/Dreamacro/clash/log" type ClashLogger struct{} func (c *ClashLogger) D(format string, args ...interface{}) { - log.Debugln(format, args) + log.Debugln(format, args...) } func (c *ClashLogger) I(format string, args ...interface{}) { - log.Infoln(format, args) + log.Infoln(format, args...) } func (c *ClashLogger) W(format string, args ...interface{}) { - log.Warnln(format, args) + log.Warnln(format, args...) } func (c *ClashLogger) E(format string, args ...interface{}) { - log.Errorln(format, args) + log.Errorln(format, args...) }