public abstract class LogSinkWhat every sink in this assembly has in common: a LogFilter, an optional LogRateLimiter, and the ILoggerProvider face that ILoggerFactory composes.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Doc 13 lists six sinks. Five of them differ only in where the line ends up, and writing the level check, the prefix match and the repeat suppression five times would guarantee they drifted — the file sink would keep a rule the console had stopped honouring, and nobody would notice until a support log was missing the line that mattered.
The one that does not fit is ZLoggerFileSink: it forwards the caller's TState untouched so that the JSON line keeps its structured fields, which a base class that hands its subclasses a formatted LogRecord cannot express. So the split is here rather than one level down — this class decides *whether* a record is written, LogRecordSink decides *what shape* it arrives in.
Fields and properties (3)
public LogFilter FilterWhich categories and levels this sink keeps.
public LogRateLimiter? RateLimiterSuppression of repeated events, or for none — which is the default, because a sink that silently drops lines has to be asked for.
public LogLevel MinimumLevelThe level below which nothing is recorded, regardless of category.
Methods (8)
protected LogSink(LogFilter? filter = null)Creates a sink, optionally sharing an existing filter.
public void SetCategoryLevel(string categoryPrefix, LogLevel level)Sets the minimum level for a category and everything beneath it.
public void ClearCategoryLevels()Forgets every per-category rule.
public bool IsEnabled(string category, LogLevel level)Whether a record at this level and category would be kept.
public abstract ILogger CreateLogger(string categoryName)Creates a new ILogger instance.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
protected bool ShouldWrite(string category, LogLevel level, EventId eventId, out int suppressedCount)The filter and the rate limiter in the order they have to run: a record the level check rejects must not consume a rate-limit token, or a category nobody is listening to would decide what a category somebody is listening to gets to say.
protected virtual void Dispose(bool disposing)Releases what the sink holds.
Used by (14)
- CategoryLoggerVixen.Core.Diagnostics
- CategoryLoggerVixen.Core.Diagnostics
- ConsoleSinkVixen.Core.Diagnostics
- DiagnosticsTestsVixen.Core.Diagnostics.Tests
- EventSourceSinkVixen.Core.Diagnostics
- LogRecordSinkVixen.Core.Diagnostics
- PlatformSinkVixen.Core.Diagnostics
- RemoteSinkVixen.Core.Diagnostics
- SinkTestsVixen.Core.Diagnostics.Tests
- ZLoggerFileSinkVixen.Core.Diagnostics
- ChromeFixtureVixen.Editor.Ui.Tests
- ConsoleTestsVixen.Editor.Ui.Tests
- ConsoleViewTestsVixen.Editor.Ui.Tests
- EditorLogVixen.Editor.App