Skip to content

Commit

Permalink
Logging!
Browse files Browse the repository at this point in the history
  • Loading branch information
LucHeart committed Jan 31, 2025
1 parent 326f38f commit bb71d1a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions LiveControlGateway/LifetimeManager/HubLifetimeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ ILoggerFactory loggerFactory
public async Task<bool> TryAddDeviceConnection(byte tps, IHubController hubController,
CancellationToken cancellationToken)
{
_logger.LogDebug("Adding hub lifetime [{HubId}]", hubController.Id);
var isSwapping = false;
HubLifetime? hubLifetime;

Expand Down Expand Up @@ -87,10 +88,12 @@ public async Task<bool> TryAddDeviceConnection(byte tps, IHubController hubContr

if (isSwapping)
{
_logger.LogTrace("Swapping hub lifetime [{HubId}]", hubController.Id);
await hubLifetime.Swap(hubController);
}
else
{
_logger.LogTrace("Initializing hub lifetime [{HubId}]", hubController.Id);
if (!await hubLifetime.InitAsync(cancellationToken))
{
// If we fail to initialize, the hub must be removed
Expand Down Expand Up @@ -129,6 +132,7 @@ private HubLifetime CreateNewLifetime(byte tps, IHubController hubController)
/// <param name="notifyLiveControlClients"></param>
public async Task RemoveDeviceConnection(IHubController hubController, bool notifyLiveControlClients = true)
{
_logger.LogDebug("Removing hub lifetime [{HubId}]", hubController.Id);
HubLifetime? hubLifetime;

using (await _lifetimesLock.LockAsyncScoped())
Expand Down

0 comments on commit bb71d1a

Please sign in to comment.