- rework: Logging logic and file logging

This commit is contained in:
2025-05-05 20:43:28 +03:00
parent cd6b4d3ad4
commit 5c53976cfe
25 changed files with 332 additions and 138 deletions

View File

@@ -1,4 +1,5 @@
using Nebula.Shared.Models;
using Nebula.Shared.Services.Logging;
namespace Nebula.Shared.Services;
@@ -7,7 +8,7 @@ public class HubService
{
private readonly ConfigurationService _configurationService;
private readonly RestService _restService;
private readonly DebugService _debugService;
private readonly ILogger _logger;
private readonly List<ServerHubInfo> _serverList = new();
@@ -19,7 +20,7 @@ public class HubService
{
_configurationService = configurationService;
_restService = restService;
_debugService = debugService;
_logger = debugService.GetLogger(this);
UpdateHub();
}
@@ -54,8 +55,8 @@ public class HubService
}
catch (Exception e)
{
_debugService.Error($"Failed to get servers for {uri}");
_debugService.Error(e);
_logger.Error($"Failed to get servers for {uri}");
_logger.Error(e);
exception = e;
}
}