using System;
namespace Unosquare.Swan {
///
/// 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() {
DisplayLoggingMessageType = IsDebuggerAttached
? LogMessageType.Debug |
LogMessageType.Error |
LogMessageType.Info |
LogMessageType.Trace |
LogMessageType.Warning |
LogMessageType.Fatal
: 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 Boolean OverrideIsConsolePresent {
get; set;
}
}
}
}