ALox  V. 2402 R. 0
Home ALox for C++ ALox for C# ALox for Java Download
Public Methods | List of all members
AnsiConsoleLogger Class Reference
Inheritance diagram for AnsiConsoleLogger:
[legend]
Collaboration diagram for AnsiConsoleLogger:
[legend]

Class Description


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.

Public Methods

 AnsiConsoleLogger (String name=null)
 
- Public Methods inherited from AnsiLogger
 AnsiLogger (System.IO.TextWriter textWriter, bool usesStdStreams, String name=null, String typeName="ANSI")
 
- Public Methods inherited from TextLogger
override int AddAcquirer (ThreadLock newAcquirer)
 
void ClearReplacements ()
 
override void Log (Domain domain, Verbosity verbosity, List< Object > logables, ScopeInfo scope)
 
override int RemoveAcquirer (ThreadLock acquirer)
 
void ResetAutoSizes ()
 
void SetReplacement (String searched, String replacement)
 
- Public Methods inherited from Logger
String GetName ()
 
String GetTypeName ()
 
override String ToString ()
 
- Public Methods inherited from SmartLock
 SmartLock ()
 
int CntAcquirers ()
 
- Public Methods inherited from ThreadLock
 ThreadLock (LockMode lockMode=LockMode.Recursive, Safeness safeness=Safeness.Safe)
 
virtual void Acquire ([CallerLineNumber] int cln=0,[CallerFilePath] String csf="",[CallerMemberName] String cmn="")
 
int DbgCountAcquirements (Thread thread=null)
 
LockMode GetMode ()
 
Safeness GetSafeness ()
 
virtual void Release ()
 
void SetSafeness (Safeness safeness)
 
override String ToString ()
 
bool WillRelease ()
 

Additional Inherited Members

- Public Types inherited from AnsiLogger
enum  LightColorUsage { _Undefined, Never, ForegroundLight, ForegroundDark }
 
- Public Static Fields inherited from AnsiLogger
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.
 
- Public Fields inherited from AnsiLogger
LightColorUsage UseLightColors
 
- Public Fields inherited from TextLogger
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
 
- Public Fields inherited from Logger
int CntLogs
 
Ticks TimeOfCreation = new Ticks()
 The creation time of the Logger.
 
Ticks TimeOfLastLog = new Ticks()
 Timestamp of the last log operation.
 
- Public Fields inherited from ThreadLock
int RecursionWarningThreshold =10
 
int waitWarningTimeLimitInMillis =1000
 
- Protected Fields inherited from AnsiLogger
String[] ansiCols
 
System.IO.TextWriter textWriter
 
- Protected Fields inherited from TextLogger
AString logBuf =new AString( 256 )
 
AString msgBuf =new AString( 128 )
 
List< String > replacements =new List<String>()
 
int stdStreamLockRegistrationCounter =0
 
bool usesStdStreams
 
- Protected Fields inherited from Logger
String Name
 
String TypeName
 
- Protected Fields inherited from SmartLock
List< ThreadLockacquirers =new List<ThreadLock>()
 
- Protected Fields inherited from ThreadLock
int cntAcquirements
 
LockMode lockMode
 
Object mutex
 
Thread owner
 
Ticks waitTime =new Ticks()
 
- Protected Methods inherited from AnsiLogger
override void logText (Domain domain, Verbosity verbosity, AString msg, ScopeInfo scope, int lineNumber)
 
override void notifyMultiLineOp (Phase phase)
 
- Protected Methods inherited from TextLogger
 TextLogger (String name, String typeName, bool usesStdStreams)
 
- Protected Methods inherited from Logger
 Logger (String name, String typeName)
 

Constructor & Destructor Documentation

◆ AnsiConsoleLogger()

AnsiConsoleLogger ( String  name = null)
inline

Creates an AnsiConsoleLogger.

Parameters
name(Optional) The name of the Logger, defaults to "ANSI_CONSOLE".

The documentation for this class was generated from the following file: