using Microsoft.Extensions.Options; namespace Iceshrimp.Frontend.Core.InMemoryLogger; internal class InMemoryLogger(IOptions config, InMemoryLogService logService) : ILogger { public void Log( LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter ) { logService.Add(formatter(state, exception)); } public bool IsEnabled(LogLevel logLevel) { return config.Value.LogLevel.HasFlag(logLevel); } public IDisposable BeginScope(TState state) where TState : notnull => default!; }