InMemoryLogBuffer
class
Namespace: Orleans.TestingHost.Logging
The in-memory log buffer which all
InMemoryLogger instances share. Useful for simulation testing where logs need to be captured and inspected. public sealed class InMemoryLogBufferRemarks
Creates a new in-memory log buffer.
Constructors
Properties
AllEntriesGets all log entries currently buffered.ApproximateSizeBytesGets the approximate size in bytes of all formatted log entries.HasWarningsOrErrorsReturns true if any warning or error entries exist.
Methods
AssertNoWarningsOrErrorsAsserts that no warnings or errors were logged, throwing an exception if any exist.ClearClears all buffered log entries.FormatAllEntriesFormats all log entries as a string.FormatAllEntriesWithSizeFormats the actual entries and returns both the formatted string and its byte size.FormatEntries(LogLevel)Formats log entries at or above the specified minimum level as a string.FormatEntriesWithSize(LogLevel)Formats entries at or above the specified level and returns both the formatted string and its byte size.GetEntries(LogLevel)Gets log entries filtered by minimum log level.HasEntriesAtOrAbove(LogLevel)Returns true if any entries exist at or above the specified log level.Log(LogLevel, EventId, TState, Exception?, Func<TState, Exception?, string>, string)Logs a message to the buffer.
