Class ErrorDisplay
This class handles displaying of errors to the screen
Inheritance
System.Object
ErrorDisplay
Implements
Microsoft.Extensions.Options.IOptionsMonitor<Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Dotnet.Shell.UI
Assembly: dotnet-shell-lib.dll
Syntax
public class ErrorDisplay : IOptionsMonitor<ConsoleLoggerOptions>
Constructors
| Improve this Doc View SourceErrorDisplay(IConsole)
Initializes a new instance of the ErrorDisplay class.
Declaration
public ErrorDisplay(IConsole console)
Parameters
| Type | Name | Description |
|---|---|---|
| IConsole | console | The console. |
Properties
| Improve this Doc View SourceCurrentValue
Returns the current TOptions instance with the Microsoft.Extensions.Options.Options.DefaultName.
Declaration
public ConsoleLoggerOptions CurrentValue { get; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions |
Methods
| Improve this Doc View SourceGet(String)
Returns a configured TOptions instance with the given name.
Declaration
public ConsoleLoggerOptions Get(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name |
Returns
| Type | Description |
|---|---|
| Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions |
OnChange(Action<ConsoleLoggerOptions, String>)
Registers a listener to be called whenever a named TOptions changes.
Declaration
public IDisposable OnChange(Action<ConsoleLoggerOptions, string> listener)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action<Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions, System.String> | listener | The action to be invoked when |
Returns
| Type | Description |
|---|---|
| System.IDisposable | An System.IDisposable which should be disposed to stop listening for changes. |
PrettyError(ColorString)
Prints the color string as an error
Declaration
public void PrettyError(ColorString msg)
Parameters
| Type | Name | Description |
|---|---|---|
| ColorString | msg | The MSG. |
PrettyError(String)
Prints the string as an error
Declaration
public void PrettyError(string msg)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | msg | The MSG. |
PrettyException(Exception, String, String)
Pretty prints the exception.
Declaration
public void PrettyException(Exception ex, string input = null, string originalInput = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Exception | ex | The ex. |
| System.String | input | The input. |
| System.String | originalInput | The original input. |
PrettyInfo(String)
Prints the string at information level
Declaration
public static void PrettyInfo(string line)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | line | The line. |
Implements
Microsoft.Extensions.Options.IOptionsMonitor<TOptions>
See Also
Microsoft.Extensions.Options.IOptionsMonitor<TOptions>