improve core log
This commit is contained in:
2 files changed
+8
-4
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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...)
|
||||
}
|
||||
Reference in new issue
Block a user