improve core log

This commit is contained in:
Kr328 committed 2020-04-23 18:52:23 +08:00
1 parent 3dc20b9e70
commit 8a98eea8fa
2 files changed
+8 -4

No files matched your search

+4
View File
@@ -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
}
+4 -4
View File
@@ -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...)
}