diff --git a/src/DurableTask.AzureStorage/DurableTask.AzureStorage.csproj b/src/DurableTask.AzureStorage/DurableTask.AzureStorage.csproj index acb32db3b..9d041c951 100644 --- a/src/DurableTask.AzureStorage/DurableTask.AzureStorage.csproj +++ b/src/DurableTask.AzureStorage/DurableTask.AzureStorage.csproj @@ -47,7 +47,6 @@ - diff --git a/src/DurableTask.Core/DurableTask.Core.csproj b/src/DurableTask.Core/DurableTask.Core.csproj index 830f0b116..55de8a177 100644 --- a/src/DurableTask.Core/DurableTask.Core.csproj +++ b/src/DurableTask.Core/DurableTask.Core.csproj @@ -37,7 +37,7 @@ - + diff --git a/test/DurableTask.AzureStorage.Tests/DurableTask.AzureStorage.Tests.csproj b/test/DurableTask.AzureStorage.Tests/DurableTask.AzureStorage.Tests.csproj index 7759315b9..6e432c0b9 100644 --- a/test/DurableTask.AzureStorage.Tests/DurableTask.AzureStorage.Tests.csproj +++ b/test/DurableTask.AzureStorage.Tests/DurableTask.AzureStorage.Tests.csproj @@ -11,16 +11,21 @@ - + + - - - + + + diff --git a/test/DurableTask.AzureStorage.Tests/TestHelpers.cs b/test/DurableTask.AzureStorage.Tests/TestHelpers.cs index 1b8740e2b..fac50044b 100644 --- a/test/DurableTask.AzureStorage.Tests/TestHelpers.cs +++ b/test/DurableTask.AzureStorage.Tests/TestHelpers.cs @@ -31,8 +31,11 @@ public static TestOrchestrationHost GetTestOrchestrationHost( { string storageConnectionString = GetTestStorageAccountConnectionString(); - // TODO: update Microsoft.Extensions.Logging to avoid the following warning suppression -#pragma warning disable CS0618 // Type or member is obsolete + var loggerFactory = LoggerFactory.Create(builder => + { + builder.AddConsole().SetMinimumLevel(LogLevel.Trace); + }); + var settings = new AzureStorageOrchestrationServiceSettings { ExtendedSessionIdleTimeout = TimeSpan.FromSeconds(extendedSessionTimeoutInSeconds), @@ -42,9 +45,8 @@ public static TestOrchestrationHost GetTestOrchestrationHost( TaskHubName = GetTestTaskHubName(), // Setting up a logger factory to enable the new DurableTask.Core logs - LoggerFactory = new LoggerFactory().AddConsole(LogLevel.Trace), + LoggerFactory = loggerFactory, }; -#pragma warning restore CS0618 // Type or member is obsolete // Give the caller a chance to make test-specific changes to the settings modifySettingsAction?.Invoke(settings); diff --git a/test/DurableTask.Core.Tests/DispatcherMiddlewareTests.cs b/test/DurableTask.Core.Tests/DispatcherMiddlewareTests.cs index cee91ef9e..4e94f9783 100644 --- a/test/DurableTask.Core.Tests/DispatcherMiddlewareTests.cs +++ b/test/DurableTask.Core.Tests/DispatcherMiddlewareTests.cs @@ -43,11 +43,10 @@ public void InitializeTests() { // configure logging so traces are emitted during tests. // This facilitates debugging when tests fail. - - // TODO: update Microsoft.Extensions.Logging to avoid the following warning suppression -#pragma warning disable CS0618 // Type or member is obsolete - var loggerFactory = new LoggerFactory().AddConsole(LogLevel.Trace); -#pragma warning restore CS0618 // Type or member is obsolete + var loggerFactory = LoggerFactory.Create(builder => + { + builder.AddConsole().SetMinimumLevel(LogLevel.Trace); + }); var service = new LocalOrchestrationService(); this.worker = new TaskHubWorker(service, loggerFactory); diff --git a/test/DurableTask.Core.Tests/DurableTask.Core.Tests.csproj b/test/DurableTask.Core.Tests/DurableTask.Core.Tests.csproj index 799f6d93d..cef62fd9d 100644 --- a/test/DurableTask.Core.Tests/DurableTask.Core.Tests.csproj +++ b/test/DurableTask.Core.Tests/DurableTask.Core.Tests.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/test/DurableTask.Core.Tests/ExceptionHandlingIntegrationTests.cs b/test/DurableTask.Core.Tests/ExceptionHandlingIntegrationTests.cs index f22825166..7fb2ef2f5 100644 --- a/test/DurableTask.Core.Tests/ExceptionHandlingIntegrationTests.cs +++ b/test/DurableTask.Core.Tests/ExceptionHandlingIntegrationTests.cs @@ -36,10 +36,10 @@ public ExceptionHandlingIntegrationTests() // configure logging so traces are emitted during tests. // This facilitates debugging when tests fail. - // TODO: update Microsoft.Extensions.Logging to avoid the following warning suppression -#pragma warning disable CS0618 // Type or member is obsolete - var loggerFactory = new LoggerFactory().AddConsole(LogLevel.Trace); -#pragma warning restore CS0618 // Type or member is obsolete + var loggerFactory = LoggerFactory.Create(builder => + { + builder.AddConsole().SetMinimumLevel(LogLevel.Trace); + }); var service = new LocalOrchestrationService(); this.worker = new TaskHubWorker(service, loggerFactory);