Skip to content

InMemoryLogBuffer Methods

The in-memory log buffer which all InMemoryLogger instances share. Useful for simulation testing where logs need to be captured and inspected.

AssertNoWarningsOrErrors

View source
public void AssertNoWarningsOrErrors()
Asserts that no warnings or errors were logged, throwing an exception if any exist.

Exceptions

System.InvalidOperationException
Thrown when warnings or errors exist in the log.

FormatAllEntriesWithSize

View source
public (string Content, long SizeBytes) InMemoryLogBuffer.FormatAllEntriesWithSize()
Formats the actual entries and returns both the formatted string and its byte size.

FormatEntries(LogLevel)

View source
public string FormatEntries(LogLevel minimumLevel)
Formats log entries at or above the specified minimum level as a string.

Parameters

minimumLevelLogLevel

FormatEntriesWithSize(LogLevel)

View source
public (string Content, long SizeBytes) InMemoryLogBuffer.FormatEntriesWithSize(LogLevel minimumLevel)
Formats entries at or above the specified level and returns both the formatted string and its byte size.

Parameters

minimumLevelLogLevel

GetEntries(LogLevel)

View source
public IEnumerable<LogEntry> GetEntries(LogLevel minimumLevel)
Gets log entries filtered by minimum log level.

Parameters

minimumLevelLogLevel