Skip to content

Commit bb71d1a

Browse files
committed
Logging!
1 parent 326f38f commit bb71d1a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

LiveControlGateway/LifetimeManager/HubLifetimeManager.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ ILoggerFactory loggerFactory
6060
public async Task<bool> TryAddDeviceConnection(byte tps, IHubController hubController,
6161
CancellationToken cancellationToken)
6262
{
63+
_logger.LogDebug("Adding hub lifetime [{HubId}]", hubController.Id);
6364
var isSwapping = false;
6465
HubLifetime? hubLifetime;
6566

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

8889
if (isSwapping)
8990
{
91+
_logger.LogTrace("Swapping hub lifetime [{HubId}]", hubController.Id);
9092
await hubLifetime.Swap(hubController);
9193
}
9294
else
9395
{
96+
_logger.LogTrace("Initializing hub lifetime [{HubId}]", hubController.Id);
9497
if (!await hubLifetime.InitAsync(cancellationToken))
9598
{
9699
// If we fail to initialize, the hub must be removed
@@ -129,6 +132,7 @@ private HubLifetime CreateNewLifetime(byte tps, IHubController hubController)
129132
/// <param name="notifyLiveControlClients"></param>
130133
public async Task RemoveDeviceConnection(IHubController hubController, bool notifyLiveControlClients = true)
131134
{
135+
_logger.LogDebug("Removing hub lifetime [{HubId}]", hubController.Id);
132136
HubLifetime? hubLifetime;
133137

134138
using (await _lifetimesLock.LockAsyncScoped())

0 commit comments

Comments
 (0)