fix: test output should go to the Xunit output

This commit is contained in:
Dylan R. E. Moonfire 2021-09-10 12:58:00 -05:00
parent 58bef22427
commit d7902d215a
2 changed files with 3 additions and 2 deletions

View file

@ -25,7 +25,7 @@
<PackageReference Include="Serilog.Exceptions" Version="7.0.0" />
<PackageReference Include="Serilog.Extensions.Autofac.DependencyInjection" Version="4.0.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="4.1.2" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.Xunit" Version="1.0.21" />
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" />
<PackageReference Include="xunit" Version="2.3.1" />
</ItemGroup>

View file

@ -23,7 +23,8 @@ namespace MfGames.TestSetup
.Enrich.WithExceptionDetails()
.Enrich.FromLogContext()
.MinimumLevel.Is(LogEventLevel.Debug)
.WriteTo.Console(
.WriteTo.TestOutput(
output,
outputTemplate:
"[{Level:u3}] {Message}{NewLine}{Exception}")
.CreateLogger();