A AnsiLogger that logs all messages to the TextWrite object found in field Console.Out. by providing this field to the constructor of its parent class AnsiLogger. See class AnsiLogger for more information on ANSI escape sequences and their use.
The name of the Logger defaults to "ANSI_CONSOLE".
- Note
- Due to the fact that mono libraries under Linux do not support light colors (they can be used, but they are equal to the dark colors), this logger is preferred over ConsoleLogger when running ALox under Linux. The readability of colorful output is better if light foreground colors are used on console windows with dark background (and vice versa).
-
While this class does not use class Console to colorize the output, within the constructor, class Console is still used to identify whether the background of the console attached to the current process has a dark or light background.
-
This class can not enable the output console (which receives ALox log data) to support ANSI Escape Codes. The opposite is right: this class should be used only if the console supports ANSI Escape Codes.
|
enum | LightColorUsage { _Undefined,
Never,
ForegroundLight,
ForegroundDark
} |
|
static readonly String | ANSI_BG_BLACK ="\x001B[40m" |
| Select black as background color.
|
|
static readonly String | ANSI_BG_BLUE ="\x001B[44m" |
| Select blue as background color.
|
|
static readonly String | ANSI_BG_CYAN ="\x001B[46m" |
| Select cyan as background color.
|
|
static readonly String | ANSI_BG_GRAY ="\x001B[48;5;240m" |
| Select gray as background color.
|
|
static readonly String | ANSI_BG_GREEN ="\x001B[42m" |
| Select green as background color.
|
|
static readonly String | ANSI_BG_LIGHT_BLUE ="\x001B[48;5;12m" |
| Select light blue as background color.
|
|
static readonly String | ANSI_BG_LIGHT_CYAN ="\x001B[48;5;14m" |
| Select light cyan as background color.
|
|
static readonly String | ANSI_BG_LIGHT_GRAY ="\x001B[48;5;250m" |
| Select light gray as background color.
|
|
static readonly String | ANSI_BG_LIGHT_GREEN ="\x001B[48;5;10m" |
| Select light green as background color.
|
|
static readonly String | ANSI_BG_LIGHT_MAGENTA ="\x001B[48;5;13m" |
| Select light magenta as background color.
|
|
static readonly String | ANSI_BG_LIGHT_RED ="\x001B[48;5;09m" |
| Select light red as background color.
|
|
static readonly String | ANSI_BG_LIGHT_YELLOW ="\x001B[48;5;11m" |
| Select light yellow as background color.
|
|
static readonly String | ANSI_BG_MAGENTA ="\x001B[45m" |
| Select magenta as background color.
|
|
static readonly String | ANSI_BG_RED ="\x001B[41m" |
| Select red as background color.
|
|
static readonly String | ANSI_BG_STD_COL ="\x001B[49m" |
| Select standard background color.
|
|
static readonly String | ANSI_BG_WHITE ="\x001B[48;5;15m" |
| Select white as background color.
|
|
static readonly String | ANSI_BG_YELLOW ="\x001B[43m" |
| Select yellow as background color.
|
|
static readonly String | ANSI_BLACK ="\x001B[30m" |
| Select black as foreground color.
|
|
static readonly String | ANSI_BLUE ="\x001B[34m" |
| Select blue as foreground color.
|
|
static readonly String | ANSI_BOLD ="\x001B[1m" |
| Select bold font style.
|
|
static readonly String | ANSI_CYAN ="\x001B[36m" |
| Select cyan as foreground color.
|
|
static readonly String | ANSI_GRAY ="\x001B[38;5;240m" |
| Select gray as foreground color.
|
|
static readonly String | ANSI_GREEN ="\x001B[32m" |
| Select green as foreground color.
|
|
static readonly String | ANSI_ITALICS ="\x001B[3m" |
| Select italics font style.
|
|
static readonly String | ANSI_LIGHT_BLUE ="\x001B[38;5;12m" |
| Select light blue as foreground color.
|
|
static readonly String | ANSI_LIGHT_CYAN ="\x001B[38;5;14m" |
| Select light cyan as foreground color.
|
|
static readonly String | ANSI_LIGHT_GRAY ="\x001B[38;5;250m" |
| Select light gray as foreground color.
|
|
static readonly String | ANSI_LIGHT_GREEN ="\x001B[38;5;10m" |
| Select light green as foreground color.
|
|
static readonly String | ANSI_LIGHT_MAGENTA ="\x001B[38;5;13m" |
| Select light magenta as foreground color.
|
|
static readonly String | ANSI_LIGHT_RED ="\x001B[38;5;09m" |
| Select light red as foreground color.
|
|
static readonly String | ANSI_LIGHT_YELLOW ="\x001B[38;5;11m" |
| Select light yellow as foreground color.
|
|
static readonly String | ANSI_MAGENTA ="\x001B[35m" |
| Select magenta as foreground color.
|
|
static readonly String | ANSI_RED ="\x001B[31m" |
| Select red as foreground color.
|
|
static readonly String | ANSI_RESET ="\x001B[0m" |
| Reset colors and font style.
|
|
static readonly String | ANSI_STD_COL ="\x001B[39m" |
| Select standard foreground color.
|
|
static readonly String | ANSI_STD_STYLE ="\x001B[0m" |
| Select standard font style.
|
|
static readonly String | ANSI_WHITE ="\x001B[38;5;15m" |
| Select white as foreground color.
|
|
static readonly String | ANSI_YELLOW ="\x001B[33m" |
| Select yellow as foreground color.
|
|
LightColorUsage | UseLightColors |
|
AutoSizes | AutoSizes = new AutoSizes() |
|
ObjectConverter | Converter |
|
String | FmtMsgSuffix ="" |
|
String | FmtMultiLineMsgHeadline ="ALox: Multi line message follows: " |
| Headline for multi line messages (depending on MultiLineMsgMode).
|
|
String | FmtMultiLinePrefix =">> " |
|
String | FmtMultiLineSuffix =null |
|
MetaInfo | MetaInfo =new MetaInfo() |
|
String | MultiLineDelimiter =null |
|
String | MultiLineDelimiterRepl ="\\r" |
|
int | MultiLineMsgMode =2 |
|
int | CntLogs |
|
Ticks | TimeOfCreation = new Ticks() |
| The creation time of the Logger.
|
|
Ticks | TimeOfLastLog = new Ticks() |
| Timestamp of the last log operation.
|
|
int | RecursionWarningThreshold =10 |
|
int | waitWarningTimeLimitInMillis =1000 |
|
String[] | ansiCols |
|
System.IO.TextWriter | textWriter |
|
AString | logBuf =new AString( 256 ) |
|
AString | msgBuf =new AString( 128 ) |
|
List< String > | replacements =new List<String>() |
|
int | stdStreamLockRegistrationCounter =0 |
|
bool | usesStdStreams |
|
String | Name |
|
String | TypeName |
|
List< ThreadLock > | acquirers =new List<ThreadLock>() |
|
int | cntAcquirements |
|
LockMode | lockMode |
|
Object | mutex |
|
Thread | owner |
|
Ticks | waitTime =new Ticks() |
|
override void | logText (Domain domain, Verbosity verbosity, AString msg, ScopeInfo scope, int lineNumber) |
|
override void | notifyMultiLineOp (Phase phase) |
|
| TextLogger (String name, String typeName, bool usesStdStreams) |
|
| Logger (String name, String typeName) |
|