From 53927d8bbd289b32332e81fb9ed182f86810ff3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Mon, 3 Jun 2024 13:03:07 +0800 Subject: [PATCH] Remove logs in router initialize --- route/router.go | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/route/router.go b/route/router.go index 54f3ac51..dfced502 100644 --- a/route/router.go +++ b/route/router.go @@ -402,20 +402,17 @@ func (r *Router) Initialize(inbounds []adapter.Inbound, outbounds []adapter.Outb defaultOutboundForPacketConnection = detour } } - var index, packetIndex int if defaultOutboundForConnection == nil { - for i, detour := range outbounds { + for _, detour := range outbounds { if common.Contains(detour.Network(), N.NetworkTCP) { - index = i defaultOutboundForConnection = detour break } } } if defaultOutboundForPacketConnection == nil { - for i, detour := range outbounds { + for _, detour := range outbounds { if common.Contains(detour.Network(), N.NetworkUDP) { - packetIndex = i defaultOutboundForPacketConnection = detour break } @@ -432,22 +429,6 @@ func (r *Router) Initialize(inbounds []adapter.Inbound, outbounds []adapter.Outb outbounds = append(outbounds, detour) outboundByTag[detour.Tag()] = detour } - if defaultOutboundForConnection != defaultOutboundForPacketConnection { - var description string - if defaultOutboundForConnection.Tag() != "" { - description = defaultOutboundForConnection.Tag() - } else { - description = F.ToString(index) - } - var packetDescription string - if defaultOutboundForPacketConnection.Tag() != "" { - packetDescription = defaultOutboundForPacketConnection.Tag() - } else { - packetDescription = F.ToString(packetIndex) - } - r.logger.Info("using ", defaultOutboundForConnection.Type(), "[", description, "] as default outbound for connection") - r.logger.Info("using ", defaultOutboundForPacketConnection.Type(), "[", packetDescription, "] as default outbound for packet connection") - } r.inboundByTag = inboundByTag r.outbounds = outbounds r.defaultOutboundForConnection = defaultOutboundForConnection