ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::lox::loggers::AnsiLogger Class Reference

Description:

A logger that logs all messages to the std::basic_ostream instance provided in the constructor. The name of the Logger defaults to "ANSI_LOGGER".

ALox text logger escape sequences (see class ESC) are translated to ANSI escape sequences. Support for ANSI escape sequences (also referred to as VT100 terminal emulation) is available on most unix terminal windows. Besides text colors, bold and italics font style can be set. ANSI escape sequences are also available in various IDE output windows.

Foreground and background colors can be set to be either light/dark or dark/light. This improves the readability of log output a lot and even allows reading if foreground and background colors are the same (they then still differ). However, the right setting for this is dependent on the color scheme of the final output device (window). To manipulate the right setting, see field CFP and also configuration variable ALOX/CONSOLE_LIGHT_COLORS.

In the method AcknowledgeLox, the default meta info string and color settings are changed to fit this logger.

Note
Instead of using ANSI sequences in the format strings directly, which would lower the run-time cost a little, ESC sequences are used because this way the light/dark color selection, which depends on the field CFP is performed correctly.

There is not 100% match between the ANSI sequences and the definitions in ESC. For example ESC does not provide all ANSI colors and no blinking. On the other hand, ANSI does not allow to reset the style without resetting the colors. Of course, it is no problem to log other ANSI codes directly into an AnsiLogger. In this case, other Loggers that might be attached to the same Lox and that do not support ANSI must be equipped with corresponding replacement information. In other words: To support the same log output into different loggers, it is recommended to use ESC sequences instead of directly using ANSI codes.

The ANSI codes used by this class are exposed through a list of fields. They might be useful for manipulating the attributes of the various inherited format variables, which of course might contain native ANSI sequences. (In contrast to the log messages themselves, this meta-information is specific to a logger instance and this way it does not need to be replaced in other loggers).

Definition at line 52 of file ansilogger.inl.

Inheritance diagram for alib::lox::loggers::AnsiLogger:
[legend]
Collaboration diagram for alib::lox::loggers::AnsiLogger:
[legend]

Public Static Field Index:

static constexpr character ANSI_BG_BLACK [6] { A_CHAR("\033[40m") }
 Select black as background color.
 
static constexpr character ANSI_BG_BLUE [6] { A_CHAR("\033[44m") }
 Select blue as background color.
 
static constexpr character ANSI_BG_CYAN [6] { A_CHAR("\033[46m") }
 Select cyan as background color.
 
static constexpr character ANSI_BG_GRAY [12] { A_CHAR("\033[48;5;240m")}
 Select gray as background color.
 
static constexpr character ANSI_BG_GREEN [6] { A_CHAR("\033[42m") }
 Select green as background color.
 
static constexpr character ANSI_BG_LIGHT_BLUE [11] { A_CHAR("\033[48;5;12m") }
 Select light blue as background color.
 
static constexpr character ANSI_BG_LIGHT_CYAN [11] { A_CHAR("\033[48;5;14m") }
 Select light cyan as background color.
 
static constexpr character ANSI_BG_LIGHT_GRAY [12] { A_CHAR("\033[48;5;250m")}
 Select light gray as background color.
 
static constexpr character ANSI_BG_LIGHT_GREEN [11] { A_CHAR("\033[48;5;10m") }
 Select light green as background color.
 
static constexpr character ANSI_BG_LIGHT_MAGENTA [11] { A_CHAR("\033[48;5;13m") }
 Select light magenta as background color.
 
static constexpr character ANSI_BG_LIGHT_RED [11] { A_CHAR("\033[48;5;09m") }
 Select light red as background color.
 
static constexpr character ANSI_BG_LIGHT_STD_COL [6] { A_CHAR("\033[49m") }
 Select standard background color.
 
static constexpr character ANSI_BG_LIGHT_YELLOW [11] { A_CHAR("\033[48;5;11m") }
 Select light yellow as background color.
 
static constexpr character ANSI_BG_MAGENTA [6] { A_CHAR("\033[45m") }
 Select magenta as background color.
 
static constexpr character ANSI_BG_RED [6] { A_CHAR("\033[41m") }
 Select red as background color.
 
static constexpr character ANSI_BG_STD_COL [6] { A_CHAR("\033[49m") }
 Select standard background color.
 
static constexpr character ANSI_BG_WHITE [11] { A_CHAR("\033[48;5;15m") }
 Select white as background color.
 
static constexpr character ANSI_BG_YELLOW [6] { A_CHAR("\033[43m") }
 Select yellow as background color.
 
static constexpr character ANSI_BLACK [6] { A_CHAR("\033[30m") }
 Select black as foreground color.
 
static constexpr character ANSI_BLUE [6] { A_CHAR("\033[34m") }
 Select blue as foreground color.
 
static constexpr character ANSI_BOLD [5] { A_CHAR("\033[1m") }
 Select bold font style.
 
static constexpr character ANSI_CYAN [6] { A_CHAR("\033[36m") }
 Select cyan as foreground color.
 
static constexpr character ANSI_GRAY [12] { A_CHAR("\033[38;5;240m")}
 Select gray as foreground color.
 
static constexpr character ANSI_GREEN [6] { A_CHAR("\033[32m") }
 Select green as foreground color.
 
static constexpr character ANSI_ITALICS [5] { A_CHAR("\033[3m") }
 Select italics font style.
 
static constexpr character ANSI_LIGHT_BLUE [11] { A_CHAR("\033[38;5;12m") }
 Select light blue as foreground color.
 
static constexpr character ANSI_LIGHT_CYAN [11] { A_CHAR("\033[38;5;14m") }
 Select light cyan as foreground color.
 
static constexpr character ANSI_LIGHT_GRAY [12] { A_CHAR("\033[38;5;250m")}
 Select light gray as foreground color.
 
static constexpr character ANSI_LIGHT_GREEN [11] { A_CHAR("\033[38;5;10m") }
 Select light green as foreground color.
 
static constexpr character ANSI_LIGHT_MAGENTA [11] { A_CHAR("\033[38;5;13m") }
 Select light magenta as foreground color.
 
static constexpr character ANSI_LIGHT_RED [11] { A_CHAR("\033[38;5;09m") }
 Select light red as foreground color.
 
static constexpr character ANSI_LIGHT_STD_COL [6] { A_CHAR("\033[39m") }
 Select standard foreground color.
 
static constexpr character ANSI_LIGHT_YELLOW [11] { A_CHAR("\033[38;5;11m") }
 Select light yellow as foreground color.
 
static constexpr character ANSI_MAGENTA [6] { A_CHAR("\033[35m") }
 Select magenta as foreground color.
 
static constexpr character ANSI_RED [6] { A_CHAR("\033[31m") }
 Select red as foreground color.
 
static constexpr character ANSI_RESET [5] { A_CHAR("\033[0m") }
 Reset colors and font style.
 
static constexpr character ANSI_STD_COL [6] { A_CHAR("\033[39m") }
 Select standard foreground color.
 
static constexpr character ANSI_STD_STYLE [5] { A_CHAR("\033[0m") }
 Select standard font style.
 
static constexpr character ANSI_WHITE [11] { A_CHAR("\033[38;5;15m") }
 Select white as foreground color.
 
static constexpr character ANSI_YELLOW [6] { A_CHAR("\033[33m") }
 Select yellow as foreground color.
 

Public Field Index:

textlogger::ColorfulLoggerParameters CFP
 
- Public Field Index: inherited from alib::lox::textlogger::TextLogger
ObjectConverterConverter = nullptr
 
TickConverter DateConverter
 
bool FormatWarningOnce = false
 
- Public Field Index: inherited from alib::lox::detail::Logger
integer CntLogs =0
 
time::Ticks TimeOfCreation
 The creation time of the Logger.
 
time::Ticks TimeOfLastLog
 Timestamp of the last log operation.
 
- Public Field Index: inherited from alib::threads::RecursiveLock
DbgLockAsserter Dbg
 The debug tool instance.
 

Public Method Index:

ALIB_DLL AnsiLogger (const NString &name=nullptr, const NString &typeName="ANSI")
 
ALIB_DLL AnsiLogger (std::ostream *pOStream, const NString &name=nullptr, const NString &typeName="ANSI")
 
virtual ALIB_DLL ~AnsiLogger () override
 Destructs an AnsiLogger.
 
- Public Method Index: inherited from alib::lox::textlogger::TextLogger
virtual ALIB_DLL ~TextLogger () override
 Destructs a TextLogger.
 
virtual ALIB_DLL void ClearReplacements ()
 Removes all pairs of searched strings and their replacement value.
 
FormatAutoSizesGetAutoSizes ()
 
FormatDateTimeGetFormatDate ()
 
FormatMetaInfoGetFormatMetaInfo ()
 
FormatMultiLineGetFormatMultiLine ()
 
FormatOtherGetFormatOther ()
 
FormatTimeDiffGetFormatTimeDiff ()
 
ReplacementsGetReplacements ()
 
virtual ALIB_DLL void Log (detail::Domain &domain, Verbosity verbosity, BoxesMA &logables, detail::ScopeInfo &scope) override
 
virtual ALIB_DLL void ResetAutoSizes ()
 
virtual ALIB_DLL void SetReplacement (const String &searched, const String &replacement)
 
- Public Method Index: inherited from alib::lox::detail::Logger
virtual ~Logger () override
 Destructs a logger.
 
const NStringGetName () const
 
const NStringGetTypeName () const
 
- Public Method Index: inherited from alib::threads::RecursiveLock
 ~RecursiveLock () override
 Destructor. With debug-compilations, asserts that this lock is not acquired.
 
ALIB_DLL void AcquireRecursive (ALIB_DBG_TAKE_CI)
 
virtual ALIB_DLL bool DCSIsAcquired () const override
 
virtual ALIB_DLL bool DCSIsSharedAcquired () const override
 
ALIB_DLL void ReleaseRecursive (ALIB_DBG_TAKE_CI)
 
ALIB_DLL bool TryAcquire (ALIB_DBG_TAKE_CI)
 
- Public Method Index: inherited from alib::lang::DbgCriticalSections::AssociatedLock
virtual ~AssociatedLock ()
 Virtual Destructor.
 

Protected Field Index:

StringWriter writer
 
- Protected Field Index: inherited from alib::lox::textlogger::TextLogger
strings::util::CalendarDateTime callerDateTime
 
AString logBuf
 The internal log Buffer.
 
AString msgBuf
 The buffers for converting the logables.
 
bool usesStdStreams
 
Variable varFormatAutoSizes
 
Variable varFormatDateTime
 
Variable varFormatMetaInfo
 
Variable varFormatMultiLine
 
Variable varFormatOther
 
Variable varFormatTimeDiff
 
Variable varReplacements
 
- Protected Field Index: inherited from alib::lox::detail::Logger
NString32 Name
 
NString32 TypeName
 
- Protected Field Index: inherited from alib::threads::RecursiveLock
std::recursive_mutex mutex
 

Protected Method Index:

virtual ALIB_DLL void AcknowledgeLox (detail::LoxImpl *lox, lang::ContainerOp op) override
 
virtual ALIB_DLL void logText (detail::Domain &domain, Verbosity verbosity, AString &msg, detail::ScopeInfo &scope, int lineNumber) override
 
virtual void notifyMultiLineOp (lang::Phase) override
 Empty implementation.
 
- Protected Method Index: inherited from alib::lox::textlogger::TextLogger
ALIB_DLL TextLogger (const NString &pName, const NString &typeName, bool pUsesStdStreams)
 
virtual ALIB_DLL void processVariable (const NString &domainPath, Verbosity verbosity, detail::ScopeInfo &scope, AString &dest, Substring &variable)
 
virtual ALIB_DLL void writeMetaInfo (AString &buffer, detail::Domain &domain, Verbosity verbosity, detail::ScopeInfo &scope)
 
virtual ALIB_DLL void writeTimeDiff (AString &buffer, int64_t diffNanos)
 
- Protected Method Index: inherited from alib::lox::detail::Logger
 Logger (const NString &name, const NString &typeName)
 
virtual void AcknowledgeLox (LoxImpl *lox, lang::ContainerOp op)
 

Field Details:

◆ ANSI_BG_BLACK

character alib::lox::loggers::AnsiLogger::ANSI_BG_BLACK[6] { A_CHAR("\033[40m") }
staticconstexpr

Select black as background color.

Definition at line 75 of file ansilogger.inl.

◆ ANSI_BG_BLUE

character alib::lox::loggers::AnsiLogger::ANSI_BG_BLUE[6] { A_CHAR("\033[44m") }
staticconstexpr

Select blue as background color.

Definition at line 72 of file ansilogger.inl.

◆ ANSI_BG_CYAN

character alib::lox::loggers::AnsiLogger::ANSI_BG_CYAN[6] { A_CHAR("\033[46m") }
staticconstexpr

Select cyan as background color.

Definition at line 74 of file ansilogger.inl.

◆ ANSI_BG_GRAY

character alib::lox::loggers::AnsiLogger::ANSI_BG_GRAY[12] { A_CHAR("\033[48;5;240m")}
staticconstexpr

Select gray as background color.

Definition at line 77 of file ansilogger.inl.

◆ ANSI_BG_GREEN

character alib::lox::loggers::AnsiLogger::ANSI_BG_GREEN[6] { A_CHAR("\033[42m") }
staticconstexpr

Select green as background color.

Definition at line 70 of file ansilogger.inl.

◆ ANSI_BG_LIGHT_BLUE

character alib::lox::loggers::AnsiLogger::ANSI_BG_LIGHT_BLUE[11] { A_CHAR("\033[48;5;12m") }
staticconstexpr

Select light blue as background color.

Definition at line 92 of file ansilogger.inl.

◆ ANSI_BG_LIGHT_CYAN

character alib::lox::loggers::AnsiLogger::ANSI_BG_LIGHT_CYAN[11] { A_CHAR("\033[48;5;14m") }
staticconstexpr

Select light cyan as background color.

Definition at line 94 of file ansilogger.inl.

◆ ANSI_BG_LIGHT_GRAY

character alib::lox::loggers::AnsiLogger::ANSI_BG_LIGHT_GRAY[12] { A_CHAR("\033[48;5;250m")}
staticconstexpr

Select light gray as background color.

Definition at line 95 of file ansilogger.inl.

◆ ANSI_BG_LIGHT_GREEN

character alib::lox::loggers::AnsiLogger::ANSI_BG_LIGHT_GREEN[11] { A_CHAR("\033[48;5;10m") }
staticconstexpr

Select light green as background color.

Definition at line 90 of file ansilogger.inl.

◆ ANSI_BG_LIGHT_MAGENTA

character alib::lox::loggers::AnsiLogger::ANSI_BG_LIGHT_MAGENTA[11] { A_CHAR("\033[48;5;13m") }
staticconstexpr

Select light magenta as background color.

Definition at line 93 of file ansilogger.inl.

◆ ANSI_BG_LIGHT_RED

character alib::lox::loggers::AnsiLogger::ANSI_BG_LIGHT_RED[11] { A_CHAR("\033[48;5;09m") }
staticconstexpr

Select light red as background color.

Definition at line 89 of file ansilogger.inl.

◆ ANSI_BG_LIGHT_STD_COL

character alib::lox::loggers::AnsiLogger::ANSI_BG_LIGHT_STD_COL[6] { A_CHAR("\033[49m") }
staticconstexpr

Select standard background color.

Definition at line 96 of file ansilogger.inl.

◆ ANSI_BG_LIGHT_YELLOW

character alib::lox::loggers::AnsiLogger::ANSI_BG_LIGHT_YELLOW[11] { A_CHAR("\033[48;5;11m") }
staticconstexpr

Select light yellow as background color.

Definition at line 91 of file ansilogger.inl.

◆ ANSI_BG_MAGENTA

character alib::lox::loggers::AnsiLogger::ANSI_BG_MAGENTA[6] { A_CHAR("\033[45m") }
staticconstexpr

Select magenta as background color.

Definition at line 73 of file ansilogger.inl.

◆ ANSI_BG_RED

character alib::lox::loggers::AnsiLogger::ANSI_BG_RED[6] { A_CHAR("\033[41m") }
staticconstexpr

Select red as background color.

Definition at line 69 of file ansilogger.inl.

◆ ANSI_BG_STD_COL

character alib::lox::loggers::AnsiLogger::ANSI_BG_STD_COL[6] { A_CHAR("\033[49m") }
staticconstexpr

Select standard background color.

Definition at line 78 of file ansilogger.inl.

◆ ANSI_BG_WHITE

character alib::lox::loggers::AnsiLogger::ANSI_BG_WHITE[11] { A_CHAR("\033[48;5;15m") }
staticconstexpr

Select white as background color.

Definition at line 76 of file ansilogger.inl.

◆ ANSI_BG_YELLOW

character alib::lox::loggers::AnsiLogger::ANSI_BG_YELLOW[6] { A_CHAR("\033[43m") }
staticconstexpr

Select yellow as background color.

Definition at line 71 of file ansilogger.inl.

◆ ANSI_BLACK

character alib::lox::loggers::AnsiLogger::ANSI_BLACK[6] { A_CHAR("\033[30m") }
staticconstexpr

Select black as foreground color.

Definition at line 64 of file ansilogger.inl.

◆ ANSI_BLUE

character alib::lox::loggers::AnsiLogger::ANSI_BLUE[6] { A_CHAR("\033[34m") }
staticconstexpr

Select blue as foreground color.

Definition at line 61 of file ansilogger.inl.

◆ ANSI_BOLD

character alib::lox::loggers::AnsiLogger::ANSI_BOLD[5] { A_CHAR("\033[1m") }
staticconstexpr

Select bold font style.

Definition at line 98 of file ansilogger.inl.

◆ ANSI_CYAN

character alib::lox::loggers::AnsiLogger::ANSI_CYAN[6] { A_CHAR("\033[36m") }
staticconstexpr

Select cyan as foreground color.

Definition at line 63 of file ansilogger.inl.

◆ ANSI_GRAY

character alib::lox::loggers::AnsiLogger::ANSI_GRAY[12] { A_CHAR("\033[38;5;240m")}
staticconstexpr

Select gray as foreground color.

Definition at line 66 of file ansilogger.inl.

◆ ANSI_GREEN

character alib::lox::loggers::AnsiLogger::ANSI_GREEN[6] { A_CHAR("\033[32m") }
staticconstexpr

Select green as foreground color.

Definition at line 59 of file ansilogger.inl.

◆ ANSI_ITALICS

character alib::lox::loggers::AnsiLogger::ANSI_ITALICS[5] { A_CHAR("\033[3m") }
staticconstexpr

Select italics font style.

Definition at line 99 of file ansilogger.inl.

◆ ANSI_LIGHT_BLUE

character alib::lox::loggers::AnsiLogger::ANSI_LIGHT_BLUE[11] { A_CHAR("\033[38;5;12m") }
staticconstexpr

Select light blue as foreground color.

Definition at line 83 of file ansilogger.inl.

◆ ANSI_LIGHT_CYAN

character alib::lox::loggers::AnsiLogger::ANSI_LIGHT_CYAN[11] { A_CHAR("\033[38;5;14m") }
staticconstexpr

Select light cyan as foreground color.

Definition at line 85 of file ansilogger.inl.

◆ ANSI_LIGHT_GRAY

character alib::lox::loggers::AnsiLogger::ANSI_LIGHT_GRAY[12] { A_CHAR("\033[38;5;250m")}
staticconstexpr

Select light gray as foreground color.

Definition at line 86 of file ansilogger.inl.

◆ ANSI_LIGHT_GREEN

character alib::lox::loggers::AnsiLogger::ANSI_LIGHT_GREEN[11] { A_CHAR("\033[38;5;10m") }
staticconstexpr

Select light green as foreground color.

Definition at line 81 of file ansilogger.inl.

◆ ANSI_LIGHT_MAGENTA

character alib::lox::loggers::AnsiLogger::ANSI_LIGHT_MAGENTA[11] { A_CHAR("\033[38;5;13m") }
staticconstexpr

Select light magenta as foreground color.

Definition at line 84 of file ansilogger.inl.

◆ ANSI_LIGHT_RED

character alib::lox::loggers::AnsiLogger::ANSI_LIGHT_RED[11] { A_CHAR("\033[38;5;09m") }
staticconstexpr

Select light red as foreground color.

Definition at line 80 of file ansilogger.inl.

◆ ANSI_LIGHT_STD_COL

character alib::lox::loggers::AnsiLogger::ANSI_LIGHT_STD_COL[6] { A_CHAR("\033[39m") }
staticconstexpr

Select standard foreground color.

Definition at line 87 of file ansilogger.inl.

◆ ANSI_LIGHT_YELLOW

character alib::lox::loggers::AnsiLogger::ANSI_LIGHT_YELLOW[11] { A_CHAR("\033[38;5;11m") }
staticconstexpr

Select light yellow as foreground color.

Definition at line 82 of file ansilogger.inl.

◆ ANSI_MAGENTA

character alib::lox::loggers::AnsiLogger::ANSI_MAGENTA[6] { A_CHAR("\033[35m") }
staticconstexpr

Select magenta as foreground color.

Definition at line 62 of file ansilogger.inl.

◆ ANSI_RED

character alib::lox::loggers::AnsiLogger::ANSI_RED[6] { A_CHAR("\033[31m") }
staticconstexpr

Select red as foreground color.

Definition at line 58 of file ansilogger.inl.

◆ ANSI_RESET

character alib::lox::loggers::AnsiLogger::ANSI_RESET[5] { A_CHAR("\033[0m") }
staticconstexpr

Reset colors and font style.

Definition at line 101 of file ansilogger.inl.

◆ ANSI_STD_COL

character alib::lox::loggers::AnsiLogger::ANSI_STD_COL[6] { A_CHAR("\033[39m") }
staticconstexpr

Select standard foreground color.

Definition at line 67 of file ansilogger.inl.

◆ ANSI_STD_STYLE

character alib::lox::loggers::AnsiLogger::ANSI_STD_STYLE[5] { A_CHAR("\033[0m") }
staticconstexpr

Select standard font style.

Definition at line 100 of file ansilogger.inl.

◆ ANSI_WHITE

character alib::lox::loggers::AnsiLogger::ANSI_WHITE[11] { A_CHAR("\033[38;5;15m") }
staticconstexpr

Select white as foreground color.

Definition at line 65 of file ansilogger.inl.

◆ ANSI_YELLOW

character alib::lox::loggers::AnsiLogger::ANSI_YELLOW[6] { A_CHAR("\033[33m") }
staticconstexpr

Select yellow as foreground color.

Definition at line 60 of file ansilogger.inl.

◆ CFP

textlogger::ColorfulLoggerParameters alib::lox::loggers::AnsiLogger::CFP

As of today, this parameter struct has only one value of type LightColorUsage. With this logger, this flag is used as follows.

Foreground and background colors chosen by this class might differ in their intensity. This increases the overall readability by increasing the contrast. If the background color of a console window is dark, then the background colors of colored log output should be darker colors than the foreground colors - and vice versa.

Depending on the setting of this field, ALox escape codes for colors are translated to normal ANSI colors or lighter ones:

  • If this field evaluates to Never, light colors are never used.
  • If this field is Foreground, colors will be light colors and background colors dark ones. This is the default.
  • With Background, background colors will be light colors and foreground colors dark ones.

The configuration variable ALOX/CONSOLE_LIGHT_COLORS allows externally modifying this flag. It is read once within the constructor.

Definition at line 142 of file ansilogger.inl.

◆ writer

StringWriter alib::lox::loggers::AnsiLogger::writer
protected

Encapsulates std::cout, std::wcout or the output stream provided in the corresponding constructor.

Definition at line 111 of file ansilogger.inl.

Constructor(s) / Destructor Details:

◆ AnsiLogger() [1/2]

ALIB_DLL alib::lox::loggers::AnsiLogger::AnsiLogger ( const NString & name = nullptr,
const NString & typeName = "ANSI" )
inlineexplicit

Creates an AnsiLogger using std::cout respectively std::wcout.

Parameters
nameThe name of the Logger, defaults to what is provided with parameter typeName.
typeNameThe type of the Logger, defaults to "ANSI".

Definition at line 155 of file ansilogger.inl.

Here is the call graph for this function:

◆ AnsiLogger() [2/2]

ALIB_DLL alib::lox::loggers::AnsiLogger::AnsiLogger ( std::ostream * pOStream,
const NString & name = nullptr,
const NString & typeName = "ANSI" )
inlineexplicit

Creates an AnsiLogger using the given output stream.

Note
If std::cout respectively std::wcout must not be provided here. Instead, the alternative constructor omitting parameter pOStream is to be used.
Parameters
pOStreamThe output stream to write into.
nameThe name of the Logger, defaults to what is provided with parameter typeName.
typeNameThe type of the Logger, defaults to "ANSI".

Definition at line 168 of file ansilogger.inl.

Here is the call graph for this function:

◆ ~AnsiLogger()

alib::lox::loggers::AnsiLogger::~AnsiLogger ( )
overridevirtual

Destructs an AnsiLogger.

Definition at line 67 of file ansilogger.cpp.

Method Details:

◆ AcknowledgeLox()

void alib::lox::loggers::AnsiLogger::AcknowledgeLox ( detail::LoxImpl * lox,
lang::ContainerOp op )
overrideprotectedvirtual

Invokes parent method. Then reads and interprets configuration variable ALOX/CONSOLE_LIGHT_COLORS. Finally it is checked if variable ALOX/LOGGERNAME/FORMAT has priority of default values, and if yes, such values are overwritten to include ANSI color codes. These color codes are retrieved from resources named "Var_D21A".

Parameters
loxThe Lox to acknowledge insertion or removal
opThe operation. Either ContainerOp::Insert or ContainerOp::Remove.

Reimplemented from alib::lox::textlogger::TextLogger.

Definition at line 38 of file ansilogger.cpp.

Here is the call graph for this function:

◆ logText()

void alib::lox::loggers::AnsiLogger::logText ( detail::Domain & domain,
Verbosity verbosity,
AString & msg,
detail::ScopeInfo & scope,
int lineNumber )
overrideprotectedvirtual

Implementation of the abstract method of parent class TextLogger. Logs messages to the basic output stream provided in the constructor. Replaces ALox ESC escape sequences with ANSI escape sequences.

Parameters
domainThe Log Domain.
verbosityThe verbosity. This has been checked to be active already on this stage and is provided to be able to be logged out only.
msgThe log message.
scopeInformation about the scope of the Log Statement..
lineNumberThe line number of a multi-line message, starting with 0. For single line messages this is -1.

Implements alib::lox::textlogger::TextLogger.

Definition at line 76 of file ansilogger.cpp.

Here is the call graph for this function:

◆ notifyMultiLineOp()

virtual void alib::lox::loggers::AnsiLogger::notifyMultiLineOp ( lang::Phase )
inlineoverrideprotectedvirtual

Empty implementation.

Implements alib::lox::textlogger::TextLogger.

Definition at line 212 of file ansilogger.inl.


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