Skip to content

Commit

Permalink
Fixed logging
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski committed Jan 31, 2025
1 parent 89be591 commit 45f3926
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Foundatio.TestHarness/Caching/CacheClientTestsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ public virtual async Task MeasureThroughputAsync()
Assert.True((await cache.GetAsync<bool>("flag")).Value);
}
sw.Stop();
_logger.LogInformation("Time: {0}ms", sw.ElapsedMilliseconds);
_logger.LogInformation("Time: {Elapsed:g}", sw.Elapsed);
}
}

Expand Down Expand Up @@ -933,7 +933,7 @@ public virtual async Task MeasureSerializerSimpleThroughputAsync()
Assert.Equal(12, model.Value.Data2);
}
sw.Stop();
_logger.LogInformation("Time: {0}ms", sw.ElapsedMilliseconds);
_logger.LogInformation("Time: {Elapsed:g}", sw.Elapsed);
}
}

Expand Down Expand Up @@ -986,7 +986,7 @@ public virtual async Task MeasureSerializerComplexThroughputAsync()
Assert.Equal(12, model.Value.Data2);
}
sw.Stop();
_logger.LogInformation("Time: {0}ms", sw.ElapsedMilliseconds);
_logger.LogInformation("Time: {Elapsed:g}", sw.Elapsed);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Foundatio/Messaging/MessageBusBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ protected virtual Task SubscribeImplAsync<T>(Func<T, CancellationToken, Task> ha
public async Task SubscribeAsync<T>(Func<T, CancellationToken, Task> handler, CancellationToken cancellationToken = default) where T : class
{
if (_logger.IsEnabled(LogLevel.Trace))
_logger.LogTrace("Adding subscriber for {MessageType}.", typeof(T).FullName);
_logger.LogTrace("Adding subscriber for {MessageType}", typeof(T).FullName);

await SubscribeImplAsync(handler, cancellationToken).AnyContext();
await EnsureTopicSubscriptionAsync(cancellationToken).AnyContext();
Expand Down Expand Up @@ -375,13 +375,13 @@ public virtual void Dispose()
{
if (_isDisposed)
{
_logger.LogTrace("MessageBus {0} dispose was already called.", MessageBusId);
_logger.LogTrace("MessageBus {MessageBusId} dispose was already called", MessageBusId);
return;
}

_isDisposed = true;

_logger.LogTrace("MessageBus {0} dispose", MessageBusId);
_logger.LogTrace("MessageBus {MessageBusId} dispose", MessageBusId);
_subscribers?.Clear();
_messageBusDisposedCancellationTokenSource?.Cancel();
_messageBusDisposedCancellationTokenSource?.Dispose();
Expand Down

0 comments on commit 45f3926

Please sign in to comment.