namespace Unosquare.Swan
{
using System;
///
/// A console terminal helper to create nicer output and receive input from the user
/// This class is thread-safe :).
///
public static partial class Terminal
{
///
/// Terminal global settings.
///
public static class Settings
{
static Settings()
{
if (IsDebuggerAttached)
{
DisplayLoggingMessageType =
LogMessageType.Debug |
LogMessageType.Error |
LogMessageType.Info |
LogMessageType.Trace |
LogMessageType.Warning |
LogMessageType.Fatal;
}
else
{
DisplayLoggingMessageType =
LogMessageType.Error |
LogMessageType.Info |
LogMessageType.Warning |
LogMessageType.Fatal;
}
GlobalLoggingMessageType = DisplayLoggingMessageType;
}
///
/// Gets or sets the default output color.
///
///
/// The default color.
///
public static ConsoleColor DefaultColor { get; set; } = Console.ForegroundColor;
///
/// Gets or sets the color of the information output logging.
///
///
/// The color of the information.
///
public static ConsoleColor InfoColor { get; set; } = ConsoleColor.Cyan;
///
/// Gets or sets the color of the debug output logging.
///
///
/// The color of the debug.
///
public static ConsoleColor DebugColor { get; set; } = ConsoleColor.Gray;
///
/// Gets or sets the color of the trace output logging.
///
///
/// The color of the trace.
///
public static ConsoleColor TraceColor { get; set; } = ConsoleColor.DarkGray;
///
/// Gets or sets the color of the warning logging.
///
///
/// The color of the warn.
///
public static ConsoleColor WarnColor { get; set; } = ConsoleColor.Yellow;
///
/// Gets or sets the color of the error logging.
///
///
/// The color of the error.
///
public static ConsoleColor ErrorColor { get; set; } = ConsoleColor.DarkRed;
///
/// Gets or sets the color of the error logging.
///
///
/// The color of the error.
///
public static ConsoleColor FatalColor { get; set; } = ConsoleColor.Red;
///
/// Gets or sets the information logging prefix.
///
///
/// The information prefix.
///
public static string InfoPrefix { get; set; } = "INF";
///
/// Gets or sets the user input prefix.
///
///
/// The user input prefix.
///
public static string UserInputPrefix { get; set; } = "USR";
///
/// Gets or sets the user option text.
///
///
/// The user option text.
///
public static string UserOptionText { get; set; } = " Option: ";
///
/// Gets or sets the debug logging prefix.
///
///
/// The debug prefix.
///
public static string DebugPrefix { get; set; } = "DBG";
///
/// Gets or sets the trace logging prefix.
///
///
/// The trace prefix.
///
public static string TracePrefix { get; set; } = "TRC";
///
/// Gets or sets the warning logging prefix.
///
///
/// The warn prefix.
///
public static string WarnPrefix { get; set; } = "WRN";
///
/// Gets or sets the fatal logging prefix.
///
///
/// The fatal prefix.
///
public static string FatalPrefix { get; set; } = "FAT";
///
/// Gets or sets the error logging prefix.
///
///
/// The error prefix.
///
public static string ErrorPrefix { get; set; } = "ERR";
///
/// Gets or sets the logging time format.
/// set to null or empty to prevent output.
///
///
/// The logging time format.
///
public static string LoggingTimeFormat { get; set; } = "HH:mm:ss.fff";
///
/// Gets or sets the logging message types (in a bitwise mask)
/// to display in the console.
///
///
/// The console options.
///
public static LogMessageType DisplayLoggingMessageType { get; set; }
///
/// Gets or sets the logging message types (in a bitwise mask) to global logging.
///
///
/// The type of the global logging message.
///
public static LogMessageType GlobalLoggingMessageType { get; set; }
///
/// Gets or sets a value indicating whether [override is console present].
///
///
/// true if [override is console present]; otherwise, false.
///
public static bool OverrideIsConsolePresent { get; set; }
}
}
}