diff --git a/src/Testcontainers.Couchbase/CouchbaseContainer.cs b/src/Testcontainers.Couchbase/CouchbaseContainer.cs index 9c196359c..64bdbe8b9 100644 --- a/src/Testcontainers.Couchbase/CouchbaseContainer.cs +++ b/src/Testcontainers.Couchbase/CouchbaseContainer.cs @@ -15,7 +15,7 @@ public CouchbaseContainer(CouchbaseConfiguration configuration) { _configuration = configuration; Starting += (_, _) => Logger.LogInformation("Couchbase container is starting, performing configuration."); - Started += (_, _) => Logger.LogInformation($"Couchbase container is ready! UI available at {new UriBuilder(Uri.UriSchemeHttp, Hostname, GetMappedPublicPort(CouchbaseBuilder.MgmtPort))}"); + Started += (_, _) => Logger.LogInformation("Couchbase container is ready! UI available at {Url}.", new UriBuilder(Uri.UriSchemeHttp, Hostname, GetMappedPublicPort(CouchbaseBuilder.MgmtPort))); } /// diff --git a/src/Testcontainers/Clients/DockerApiClient.cs b/src/Testcontainers/Clients/DockerApiClient.cs index 0bc991f22..cf8f1d91a 100644 --- a/src/Testcontainers/Clients/DockerApiClient.cs +++ b/src/Testcontainers/Clients/DockerApiClient.cs @@ -109,7 +109,7 @@ await RuntimeInitialized.WaitAsync(ct) runtimeInfo.Append(" Total Memory: "); runtimeInfo.AppendFormat(CultureInfo.InvariantCulture, "{0:F} {1}", dockerInfo.MemTotal / Math.Pow(1024, byteUnits.Length), byteUnits[byteUnits.Length - 1]); - Logger.LogInformation(runtimeInfo.ToString()); + Logger.LogInformation("{RuntimeInfo}", runtimeInfo); } catch(Exception e) { diff --git a/tests/Testcontainers.Platform.Linux.Tests/LoggerTest.cs b/tests/Testcontainers.Platform.Linux.Tests/LoggerTest.cs index 6cecc4fdb..518b54762 100644 --- a/tests/Testcontainers.Platform.Linux.Tests/LoggerTest.cs +++ b/tests/Testcontainers.Platform.Linux.Tests/LoggerTest.cs @@ -30,7 +30,7 @@ public Task DisposeAsync() [InlineData(2)] public void LogContainerRuntimeInformationOnce(int _) { - Assert.Contains("Connected to Docker", _fakeLogger.Collector.GetSnapshot().First().Message); + Assert.Contains("Connected to Docker", _fakeLogger.Collector.GetSnapshot()[0].Message); } [UsedImplicitly]