ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Public Static Fields | Public Static Methods | List of all members
ESC Class Reference

#include <alox.hpp>

Class Description


This class defines "escape sequences" that influence the formatting of log output. Specific implementations of class Logger have to convert or interpret this classes definitions of escape sequences when processing log data. If no formatting of the output is supported by a specific Logger implementation, such logger should filter and discard escape sequences defined here.

The sequences are similar to ANSI Escape sequences and logger classes that log to 'VT100' compatible terminals will simply convert them.

The name of the class was intentionally chosen to be short, because the escape codes defined with this class will be concatenated to log strings like that:

Log_Info( "The result is: ", ESC::RED, 42 )
Note
With the introduction of own, ALox specific escape codes, software that uses ALox becomes independent from any underlying, platform-specific sequences. For example, ALox is not relying on ANSI color codes, which are not supported by colorful Windows consoles. Instead, on each platform, dedicated Loggers will perform the translation of ALox codes to platform-specific ones.

Definition at line 202 of file alox/alox.hpp.

Public Static Fields

static ALIB_API character BG_BLACK [4] { A_CHAR("\033C6") }
 Select red color for background.
 
static ALIB_API character BG_BLUE [4] { A_CHAR("\033C3") }
 Select blue color for background.
 
static ALIB_API character BG_CYAN [4] { A_CHAR("\033C5") }
 Select blue color for background.
 
static ALIB_API character BG_GRAY [4] { A_CHAR("\033C8") }
 Select gray color for background.
 
static ALIB_API character BG_GREEN [4] { A_CHAR("\033C1") }
 Select green color for background.
 
static ALIB_API character BG_MAGENTA [4] { A_CHAR("\033C4") }
 Select blue color for background.
 
static ALIB_API character BG_RED [4] { A_CHAR("\033C0") }
 Select red color for background.
 
static ALIB_API character BG_RESET [4] { A_CHAR("\033C9") }
 Select std color for background.
 
static ALIB_API character BG_WHITE [4] { A_CHAR("\033C7") }
 Select blue color for background.
 
static ALIB_API character BG_YELLOW [4] { A_CHAR("\033C2") }
 Select yellow color for background.
 
static ALIB_API character BLACK [4] { A_CHAR("\033c6") }
 Select black color for foreground.
 
static ALIB_API character BLUE [4] { A_CHAR("\033c3") }
 Select blue color for foreground.
 
static ALIB_API character BOLD [4] { A_CHAR("\033sB") }
 Select bold font style.
 
static ALIB_API character CYAN [4] { A_CHAR("\033c5") }
 Select cyan color for foreground.
 
static ALIB_API character EOMETA [4] { A_CHAR("\033A0") }
 End of meta information in log string.
 
static ALIB_API character FG_RESET [4] { A_CHAR("\033c9") }
 Select std color for foreground. More...
 
static ALIB_API character GRAY [4] { A_CHAR("\033c8") }
 Select gray color for foreground.
 
static ALIB_API character GREEN [4] { A_CHAR("\033c1") }
 Select green color for foreground.
 
static ALIB_API character ITALICS [4] { A_CHAR("\033sI") }
 Select italics font style.
 
static ALIB_API character MAGENTA [4] { A_CHAR("\033c4") }
 Select magenta color for foreground.
 
static ALIB_API character RED [4] { A_CHAR("\033c0") }
 Select red color for foreground.
 
static ALIB_API character RESET [4] { A_CHAR("\033sa") }
 Reset color and style.
 
static ALIB_API character STYLE_RESET [4] { A_CHAR("\033sr") }
 Select standard font style.
 
static ALIB_API character TAB [4] { A_CHAR("\033t0") }
 Go to next tab. Usually, text loggers will increase the tab position automatically.
 
static ALIB_API character URL_END [4] { A_CHAR("\033lE") }
 Mark the end of an URL.
 
static ALIB_API character URL_START [4] { A_CHAR("\033lS") }
 Mark the start of an URL.
 
static ALIB_API character WHITE [4] { A_CHAR("\033c7") }
 Select white color for foreground.
 
static ALIB_API character YELLOW [4] { A_CHAR("\033c2") }
 Select yellow color for foreground.
 

Public Static Methods

static ALIB_API void ReplaceToReadable (AString &target, integer startIdx)
 

Member Function Documentation

◆ ReplaceToReadable()

void ReplaceToReadable ( AString target,
integer  startIdx 
)
static

Replaces ESC codes in a string reversely to "ESC::XXX".

Parameters
targetThe string to replace in.
startIdxThe index to start searching for ESC codes.

Definition at line 479 of file aloxmodule.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ FG_RESET

character FG_RESET { A_CHAR("\033c9") }
static

Select std color for foreground.

Select std color for foreground.4.

Definition at line 220 of file alox/alox.hpp.


The documentation for this class was generated from the following files:
aworx::lib::lox::ESC::RED
static ALIB_API character RED[4]
Select red color for foreground.
Definition: alox/alox.hpp:211
Log_Info
#define Log_Info(...)
Definition: macros.inl:68