From afd904282c7cd9ef7010402e2b98072a392e4fc0 Mon Sep 17 00:00:00 2001 From: Virx Date: Wed, 18 Dec 2024 16:53:29 -0500 Subject: [PATCH] Don't log twice on exit --- RLBotCS/Main.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/RLBotCS/Main.cs b/RLBotCS/Main.cs index 29627a1..62b288c 100644 --- a/RLBotCS/Main.cs +++ b/RLBotCS/Main.cs @@ -82,15 +82,17 @@ bridgeHandler.Start(); // Block until everything properly shuts down -void WaitForShutdown() +void WaitForShutdown(bool log = true) { rlbotServer.Join(); - logger.LogInformation("RLBot server has shut down successfully."); + if (log) + logger.LogInformation("TCP handler has shut down successfully."); bridgeWriter.TryComplete(); bridgeHandler.Join(); - logger.LogInformation("Bridge handler has shut down successfully."); + if (log) + logger.LogInformation("Bridge handler has shut down successfully."); } void Terminate() @@ -108,4 +110,4 @@ void Terminate() Console.CancelKeyPress += (_, _) => Terminate(); // Wait for a normal shutdown -WaitForShutdown(); +WaitForShutdown(false);