Table of Contents

Class LogBuffer

Namespace
MiniTui
Assembly
MiniTui.dll

A thread-safe ring buffer of log lines. While an app runs with console capture on (the default), everything written to Out and Error lands here (§6.6).

public sealed class LogBuffer
Inheritance
LogBuffer
Inherited Members

Constructors

LogBuffer(int)

Create a buffer that keeps the last capacity lines.

public LogBuffer(int capacity = 1000)

Parameters

capacity int

Properties

Capacity

The maximum number of lines kept. Older lines are dropped.

public int Capacity { get; }

Property Value

int

Count

The number of lines currently held.

public int Count { get; }

Property Value

int

Methods

Add(string, bool)

Append a line, timestamped now.

public void Add(string text, bool isError = false)

Parameters

text string
isError bool

Clear()

Remove all lines.

public void Clear()

Snapshot()

A copy of the held lines, oldest first.

public IReadOnlyList<LogEntry> Snapshot()

Returns

IReadOnlyList<LogEntry>