(Yet) Another .NET Logger - xUnit Sink
Currently the project is DISCONTINUED. However, feel free to fork it and continue its development!
Allows writing of logs to the xUnit test console using Anlog.
Install Anlog.Sinks.xUnit from the NuGet Gallery in the test project:
Install-Package Anlog.Sinks.xUnit
In a xUnit test, receive the ITestOutputHelper
through constructor and call the WriteLogs()
method:
using Xunit;
using Xunit.Abstractions;
using Anlog.Sinks.XUnit;
namespace MyProject.Tests
{
public sealed class MyTest
{
public MyTest(ITestOutputHelper output)
{
output.WriteLogs();
}
[Fact]
public void WhenSomething_ThenTest()
{
...
}
}
}
Any logs written to Anlog will then be forwarded to the xUnit test output console.
Licensed under the The MIT License (MIT). Please see LICENSE for more information.