using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; namespace SystemExtensions.NetStandard.Tests.Logging.Models; public sealed class CachingLogger : ILogger { public List LogCache { get; } = new(); public IDisposable BeginScope(TState state) { throw new NotImplementedException(); } public bool IsEnabled(LogLevel logLevel) { return true; } public void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter) { var message = formatter(state, exception); this.LogCache.Add(message); } }