Skip to content

Commit 1041b4e

Browse files
committed
revert setupcommand to having a parameterless constructor for activator creation
1 parent 573d9a2 commit 1041b4e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/ServiceControl.Audit.AcceptanceTests/TestSupport/ServiceControlComponentRunner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ async Task InitializeServiceControl(ScenarioContext context)
9898

9999
using (new DiagnosticTimer($"Creating infrastructure for {instanceName}"))
100100
{
101-
var setupCommand = new SetupCommand(LoggerUtil.CreateStaticLogger<SetupCommand>());
101+
var setupCommand = new SetupCommand();
102102
await setupCommand.Execute(new HostArguments([]), settings);
103103
}
104104

src/ServiceControl.Audit.UnitTests/Infrastructure/When_instance_is_setup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public async Task Should_provision_queues()
4242
AssemblyLoadContextResolver = static _ => AssemblyLoadContext.Default
4343
};
4444

45-
var setupCommand = new SetupCommand(LoggerUtil.CreateStaticLogger<SetupCommand>());
45+
var setupCommand = new SetupCommand();
4646
await setupCommand.Execute(new HostArguments([]), settings);
4747

4848
Assert.That(FakeTransport.QueuesCreated, Is.EquivalentTo(new[]

src/ServiceControl.Audit/Infrastructure/Hosting/Commands/SetupCommand.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@
55
using System.Threading.Tasks;
66
using Microsoft.Extensions.Hosting;
77
using Microsoft.Extensions.Logging;
8+
using ServiceControl.Infrastructure;
89
using Settings;
910
using Transports;
1011

11-
class SetupCommand(ILogger<SetupCommand> logger) : AbstractCommand
12+
class SetupCommand() : AbstractCommand
1213
{
1314
public override async Task Execute(HostArguments args, Settings settings)
1415
{
1516
if (settings.IngestAuditMessages)
1617
{
1718
if (args.SkipQueueCreation)
1819
{
19-
logger.LogInformation("Skipping queue creation");
20+
LoggerUtil.CreateStaticLogger<SetupCommand>().LogInformation("Skipping queue creation");
2021
}
2122
else
2223
{

0 commit comments

Comments
 (0)