Class ConsoleReporter
- Namespace
- McMaster.Extensions.CommandLineUtils
- Assembly
- McMaster.Extensions.CommandLineUtils.dll
A thread-safe reporter that forwards to console output.
public class ConsoleReporter : IReporter
- Inheritance
-
objectConsoleReporter
- Implements
Constructors
ConsoleReporter(IConsole)
Initializes an instance of ConsoleReporter.
public ConsoleReporter(IConsole console)
Parameters
consoleIConsole
ConsoleReporter(IConsole, bool, bool)
Initializes an instance of ConsoleReporter.
public ConsoleReporter(IConsole console, bool verbose, bool quiet)
Parameters
consoleIConsoleverboseboolWhen false, Verbose does not display output.
quietboolWhen true, only Warn and Error display output
Properties
Console
The console to write to.
protected IConsole Console { get; }
Property Value
IsQuiet
Is verbose output and regular output hidden.
public bool IsQuiet { get; set; }
Property Value
IsVerbose
Is verbose output displayed.
public bool IsVerbose { get; set; }
Property Value
Methods
Error(string)
public virtual void Error(string message)
Parameters
messagestring
Output(string)
Writes a message to Out.
public virtual void Output(string message)
Parameters
messagestring
Verbose(string)
public virtual void Verbose(string message)
Parameters
messagestring
Warn(string)
public virtual void Warn(string message)
Parameters
messagestring
WriteLine(TextWriter, string, ConsoleColor?, ConsoleColor?)
Write a line with color.
protected virtual void WriteLine(TextWriter writer, string message, ConsoleColor? foregroundColor, ConsoleColor? backgroundColor = null)
Parameters
writerTextWritermessagestringforegroundColorConsoleColor?backgroundColorConsoleColor?