From aa382585bd5a793ae14933843b2857785d8c7db5 Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 14 Feb 2025 15:14:19 +0100 Subject: [PATCH] Add logging for http and websocket start --- Libraries/Core/Servers/HttpServer.cs | 5 +++++ Libraries/Core/Utils/App.cs | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/Libraries/Core/Servers/HttpServer.cs b/Libraries/Core/Servers/HttpServer.cs index 2e4ac012..da98af85 100644 --- a/Libraries/Core/Servers/HttpServer.cs +++ b/Libraries/Core/Servers/HttpServer.cs @@ -135,4 +135,9 @@ public class HttpServer( { return started; } + + public string ListeningUrl() + { + return $"http://{_httpConfig.Ip}:{_httpConfig.Port}"; + } } diff --git a/Libraries/Core/Utils/App.cs b/Libraries/Core/Utils/App.cs index a532ce16..9a1681a8 100644 --- a/Libraries/Core/Utils/App.cs +++ b/Libraries/Core/Utils/App.cs @@ -87,6 +87,12 @@ public class App _timer = new Timer(_ => Update(_onUpdate), null, TimeSpan.Zero, TimeSpan.FromMilliseconds(5000)); + if (_httpServer.IsStarted()) + { + _logger.Success(_localisationService.GetText("started_webserver_success", _httpServer.ListeningUrl())); + _logger.Success(_localisationService.GetText("websocket-started", _httpServer.ListeningUrl().Replace("http://", "ws://"))); + } + _logger.Success(GetRandomisedStartMessage()); }