From 3264a33e5b38afc12de190f4353025fbe8b699a3 Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Sat, 13 Nov 2021 14:21:39 +0800 Subject: [PATCH] Disable RouteUtils Log --- Netch/Utils/RouteUtils.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Netch/Utils/RouteUtils.cs b/Netch/Utils/RouteUtils.cs index e24a9953..c1438670 100644 --- a/Netch/Utils/RouteUtils.cs +++ b/Netch/Utils/RouteUtils.cs @@ -5,6 +5,7 @@ using Netch.Models; namespace Netch.Utils; +// #define DEBUG_TUN public static class RouteUtils { public static void CreateRouteFill(NetRoute template, IEnumerable rules, int? metric = null) @@ -26,6 +27,7 @@ public static class RouteUtils public static bool CreateRoute(NetRoute o) { +#if DEBUG_TUN Log.Verbose("CreateRoute {InterNetwork} {Address} {Cidr} {Gateway} {Interface} {Metric}", AddressFamily.InterNetwork, o.Network, @@ -34,6 +36,7 @@ public static class RouteUtils (ulong)o.InterfaceIndex, o.Metric); +#endif return RouteHelper.CreateRoute(AddressFamily.InterNetwork, o.Network, o.Cidr, o.Gateway, (ulong)o.InterfaceIndex, o.Metric); } @@ -56,6 +59,7 @@ public static class RouteUtils public static bool DeleteRoute(NetRoute o) { +#if DEBUG_TUN Log.Verbose("DeleteRoute {InterNetwork} {Address} {Cidr} {Gateway} {Interface} {Metric}", AddressFamily.InterNetwork, o.Network, @@ -64,6 +68,7 @@ public static class RouteUtils (ulong)o.InterfaceIndex, o.Metric); +#endif return RouteHelper.DeleteRoute(AddressFamily.InterNetwork, o.Network, o.Cidr, o.Gateway, (ulong)o.InterfaceIndex, o.Metric); }