using System; using Microsoft.Extensions.Logging; namespace NUnit.Framework { public static class TestLogger { public static ILogger Create() { var logger = new NUnitLogger(); return logger; } class NUnitLogger : ILogger, IDisposable { private readonly Action output = Console.WriteLine; public void Dispose() { } public void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter) => output(formatter(state, exception)); public bool IsEnabled(LogLevel logLevel) => true; public IDisposable BeginScope(TState state) => this; } } }