Skip to content

Commit 45f3926

Browse files
committed
Fixed logging
1 parent 89be591 commit 45f3926

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Foundatio.TestHarness/Caching/CacheClientTestsBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ public virtual async Task MeasureThroughputAsync()
904904
Assert.True((await cache.GetAsync<bool>("flag")).Value);
905905
}
906906
sw.Stop();
907-
_logger.LogInformation("Time: {0}ms", sw.ElapsedMilliseconds);
907+
_logger.LogInformation("Time: {Elapsed:g}", sw.Elapsed);
908908
}
909909
}
910910

@@ -933,7 +933,7 @@ public virtual async Task MeasureSerializerSimpleThroughputAsync()
933933
Assert.Equal(12, model.Value.Data2);
934934
}
935935
sw.Stop();
936-
_logger.LogInformation("Time: {0}ms", sw.ElapsedMilliseconds);
936+
_logger.LogInformation("Time: {Elapsed:g}", sw.Elapsed);
937937
}
938938
}
939939

@@ -986,7 +986,7 @@ public virtual async Task MeasureSerializerComplexThroughputAsync()
986986
Assert.Equal(12, model.Value.Data2);
987987
}
988988
sw.Stop();
989-
_logger.LogInformation("Time: {0}ms", sw.ElapsedMilliseconds);
989+
_logger.LogInformation("Time: {Elapsed:g}", sw.Elapsed);
990990
}
991991
}
992992
}

src/Foundatio/Messaging/MessageBusBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ protected virtual Task SubscribeImplAsync<T>(Func<T, CancellationToken, Task> ha
151151
public async Task SubscribeAsync<T>(Func<T, CancellationToken, Task> handler, CancellationToken cancellationToken = default) where T : class
152152
{
153153
if (_logger.IsEnabled(LogLevel.Trace))
154-
_logger.LogTrace("Adding subscriber for {MessageType}.", typeof(T).FullName);
154+
_logger.LogTrace("Adding subscriber for {MessageType}", typeof(T).FullName);
155155

156156
await SubscribeImplAsync(handler, cancellationToken).AnyContext();
157157
await EnsureTopicSubscriptionAsync(cancellationToken).AnyContext();
@@ -375,13 +375,13 @@ public virtual void Dispose()
375375
{
376376
if (_isDisposed)
377377
{
378-
_logger.LogTrace("MessageBus {0} dispose was already called.", MessageBusId);
378+
_logger.LogTrace("MessageBus {MessageBusId} dispose was already called", MessageBusId);
379379
return;
380380
}
381381

382382
_isDisposed = true;
383383

384-
_logger.LogTrace("MessageBus {0} dispose", MessageBusId);
384+
_logger.LogTrace("MessageBus {MessageBusId} dispose", MessageBusId);
385385
_subscribers?.Clear();
386386
_messageBusDisposedCancellationTokenSource?.Cancel();
387387
_messageBusDisposedCancellationTokenSource?.Dispose();

0 commit comments

Comments
 (0)