Skip to content
ConsoleMonster
Class

LogFilter

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Modifiers
sealed

Which log entries a log region, log viewport or log tail shows: one source tag, a minimum level and a literal text. Every part that is set must match. Hidden entries stay in the retained history, so changing the filter brings them back.

Inheritance

  • object
  • LogFilter

Usage

Explore 6 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 2

Accepted by parameters 4

Constructors

public LogFilter(string? tag = null, string? level = null, string? text = null) #

Creates a filter; null or empty parts match every entry.

Parameters

tag string? = null optional
The source tag to show, compared without case, or null for every source.
level string? = null optional
The lowest level to show (debug, verbose, info, warn, err; pass and skip rank with info), or null for every level.
text string? = null optional
Literal text the entry must contain, compared without case, or null.

Exceptions

  • ArgumentException – The level is not a log level or status word.

Methods

public bool Matches(LogEntry entry) #

Whether an entry passes the filter.

Parameters

entry ConsoleMonster.Widgets.LogEntry required
The entry.

Returns

bool True when the entry is shown.

Properties

public string? Tag { get; } #

The source tag to show, or null.

public string? Level { get; } #

The lowest level shown, as a canonical level name, or null.

public string? Text { get; } #

Literal text an entry must contain, or null.

public bool IsEmpty { get; } #

Whether every part is empty, so the filter shows everything.