Skip to content
ConsoleMonster

API Reference

Class

LogLevels

Namespace ConsoleMonster.Styling
Assembly ConsoleMonster
Modifiers static

Log levels for log regions and Write-ConsoleLog: info, warn, err, 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) #
Returns: StatusKind?

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

Parameters

level System.String? requiredposition: 0
A level or status word.

Returns

The status, or null.

public static Boolean TryNormalize(String? text, out String level) #
Returns: Boolean

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

Parameters

text System.String? requiredposition: 0
The word (case does not matter).
level System.String requiredposition: 1
The canonical level.

Returns

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.