Interface ILogRecordFilter
- Namespace
- LogAssertions
- Assembly
- LogAssertions.dll
A composable filter over Microsoft.Extensions.Logging.Testing.FakeLogRecord. Built-in filter methods on the
assertion fluent chain (AtLevel, Containing, etc.) each create one of these
internally; WithFilter(ILogRecordFilter) on the chain accepts arbitrary user
implementations, and the LogFilter static factory composes them via
All, Any, and Not.
public interface ILogRecordFilter
Remarks
Implementations should be inexpensive to evaluate: they are invoked once per captured
record per assertion. The Description is rendered into the expectation line
of failure messages and should be terse and human-readable (e.g. "Level = Warning",
not a full sentence).
Properties
Description
A short human-readable description used in the expectation summary on failure
(for example "Level = Warning" or "Message contains "timeout"").
string Description { get; }
Property Value
Methods
Matches(FakeLogRecord)
Returns true when record satisfies this filter.
bool Matches(FakeLogRecord record)
Parameters
recordFakeLogRecordThe record to test.