TuiLoggerProvider Pennington.Tui.Logging
ILoggerProvider that routes every log record into the shared BoundedSequenceLog<LogEntry> so the TUI's Main tab can render them. Replaces the console logger provider (which would otherwise corrupt XenoAtom's terminal frames).
Constructors
.ctor
#public sealed class TuiLoggerProvider(BoundedSequenceLog<LogEntry> buffer, LogLevel minLevel) : ILoggerProvider
{
private readonly ConcurrentDictionary<string, TuiLogger> _loggers = new();
/// <summary>Returns the <see cref="TuiLogger"/> for the given category, creating one on first use.</summary>
public ILogger CreateLogger(string categoryName) =>
_loggers.GetOrAdd(categoryName, name => new TuiLogger(name, buffer, minLevel));
/// <summary>Drops cached loggers; the underlying buffer is owned elsewhere.</summary>
public void Dispose() => _loggers.Clear();
}ILoggerProvider that routes every log record into the shared BoundedSequenceLog<LogEntry> so the TUI's Main tab can render them. Replaces the console logger provider (which would otherwise corrupt XenoAtom's terminal frames).
Parameters
bufferBoundedSequenceLog<LogEntry>minLevelLogLevel
Methods
Pennington.Tui.Logging.TuiLoggerProvider
namespace Pennington.Tui.Logging;
/// ILoggerProvider that routes every log record into the shared BoundedSequenceLog<LogEntry> so the TUI's Main tab can render them. Replaces the console logger provider (which would otherwise corrupt XenoAtom's terminal frames).
public class TuiLoggerProvider
{
/// ILoggerProvider that routes every log record into the shared BoundedSequenceLog<LogEntry> so the TUI's Main tab can render them. Replaces the console logger provider (which would otherwise corrupt XenoAtom's terminal frames).
public sealed class TuiLoggerProvider(BoundedSequenceLog<LogEntry> buffer, LogLevel minLevel) : ILoggerProvider
{
private readonly ConcurrentDictionary<string, TuiLogger> _loggers = new();
/// <summary>Returns the <see cref="TuiLogger"/> for the given category, creating one on first use.</summary>
public ILogger CreateLogger(string categoryName) =>
_loggers.GetOrAdd(categoryName, name => new TuiLogger(name, buffer, minLevel));
/// <summary>Drops cached loggers; the underlying buffer is owned elsewhere.</summary>
public void Dispose() => _loggers.Clear();
}
/// Returns the TuiLogger for the given category, creating one on first use.
public ILogger CreateLogger(string categoryName);
/// Drops cached loggers; the underlying buffer is owned elsewhere.
public void Dispose();
}