Skip to content
ConsoleMonster
Class

LogLevels

ConsoleMonster.Styling

Namespace
ConsoleMonster.Styling
Assembly
ConsoleMonster
Modifiers
static

Log levels for log regions and Write-ConsoleLogEntry: info, warn, err, critical, verbose, debug, pass and skip. PowerShell's own words (Information, Warning, Error, Verbose, Debug, Success...) and the status words map onto them, so one vocabulary works for statuses and logs.

Inheritance

  • object
  • LogLevels

Methods

public static StatusKind? ToStatus(string? level) #

The status a level is marked with (critical and err → Fail, warn → Warn, pass → Pass, skip → Skip), or null for info, verbose and debug.

Parameters

level string? required
A level or status word.

Returns

StatusKind? The status, or null.
public static bool TryNormalize(string? text, out string level) #

Maps a level or status word to a canonical level name.

Parameters

text string? required
The word (case does not matter).
level string required
The canonical level.

Returns

bool Whether the word was recognised.

Properties

public static IReadOnlyList<string> Names { get; } #

The canonical level names.

public static IReadOnlyList<string> Words { get; } #

The words LogLevels.TryNormalize accepts, for argument completion.