From e8626942b5884028c7315c9849a7e6c27e1caa8d Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Mon, 30 Dec 2024 13:27:26 -0800 Subject: [PATCH] Adds exception message to logger for TCP Server. --- Projects/Server/Network/TcpServer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Projects/Server/Network/TcpServer.cs b/Projects/Server/Network/TcpServer.cs index 52a5201c8c..d2c6751c8b 100644 --- a/Projects/Server/Network/TcpServer.cs +++ b/Projects/Server/Network/TcpServer.cs @@ -62,7 +62,7 @@ public static void Start() foreach (var ipep in listeningAddresses) { - logger.Information("Listening: {Address}:{Port}", ipep.Address, ipep.Port); + logger.Information("Listening: {Address}", ipep); } ListeningAddresses = listeningAddresses.ToArray(); @@ -107,16 +107,16 @@ public static Socket CreateListener(IPEndPoint ipep) // WSAEADDRINUSE if (se.ErrorCode == 10048) { - logger.Warning("Listener: {Address}:{Port}: Failed (In Use)", ipep.Address, ipep.Port); + logger.Warning("Listener: {Address} Exception: {Reason}", ipep, "Currently in use"); } // WSAEADDRNOTAVAIL else if (se.ErrorCode == 10049) { - logger.Warning("Listener {Address}:{Port}: Failed (Unavailable)", ipep.Address, ipep.Port); + logger.Warning("Listener {Address} Exception: {Reason}", ipep, "Unavailable"); } else { - logger.Warning(se, "Listener Exception:"); + logger.Warning(se, "Listener {Address} Exception: {Reason}", ipep, se.Message); } }