This is the C++ version of ALox Logging Library, which has been integrated as one of many modules into the ALib C++ Framework.
Please check out the documentation of ALib Module ALox for more information.
Nested Namespaces: | |
| namespace | detail |
| namespace | loggers |
| namespace | textlogger |
| This namespaces defines class TextLogger and its helpers. | |
Type Index: | |
| class | ALoxCamp |
| struct | CVVerbosities |
| class | ESC |
| class | Log |
| class | LogTools |
| class | Lox |
| This class acts as a container for Loggers and provides a convenient interface to logging. More... | |
Enumeration Index: | |
| enum class | Scope { Global , ThreadOuter , Filename , Method , ThreadInner , Path } |
| enum class | StateInfo { NONE = 0 , Basic = 1 << 0 , Version = 1 << 1 , Loggers = 1 << 2 , Domains = 1 << 3 , InternalDomains = 1 << 4 , ScopeDomains = 1 << 5 , DSR = 1 << 6 , PrefixLogables = 1 << 7 , Once = 1 << 8 , LogData = 1 << 9 , ThreadMappings = 1 << 10 , SPTR = 1 << 20 , CompilationFlags = 1 << 21 , All = ~0L } |
| enum class | Variables { NO_IDE_LOGGER = 1 , CONSOLE_TYPE = 2 , VERBOSITY = 3 , SPTR_GLOBAL = 4 , SPTR_LOX = 5 , DOMAIN_SUBSTITUTION = 6 , PREFIXES = 7 , DUMP_STATE_ON_EXIT = 8 , AUTO_SIZES = 20 , FORMAT = 21 , FORMAT_DATE_TIME = 22 , FORMAT_MULTILINE = 23 , FORMAT_TIME_DIFF = 24 , FORMAT_OTHER = 25 , REPLACEMENTS = 26 , CONSOLE_LIGHT_COLORS = 27 , CODEPAGE = 28 } |
| enum class | Verbosity : uint8_t { Off , Error , Warning , Info , Verbose } |
Function Index: | |
| void | ALoxAssertionPlugin (const lang::CallerInfo &ci, int type, std::string_view domain, std::string_view msg) |
Variable Index: | |
| std::string_view const | ALOX_ASSERTION_PLUGIN_DOMAIN_PREFIX = "/ALIB" |
| Lox * | DEBUG_LOX |
|
strong |
These are definitions that are used as a parameter to certain ALox methods to denote the Scope of a setting. Scopes are dependent of the programming language and hence differ slightly from each other in the different versions of ALox.
This enumeration is an ALib arithmetical enum. However, the addition of values is only allowed with the last element, Path. By adding integer values, the Nth parent directory of a source file's location are addressed. As an example, invocations like this are used to select the source directory two levels above the source code file for a prefix scope:
lox->SetPrefix( #"> , Scope::Path + 2 );
For more information on Scopes consult the ALib Module ALox - Programmer's Manual.
| Enumerator | |
|---|---|
| Global | Denotes the global (singleton) scope. |
| ThreadOuter | Denotes the actual thread as the scope. When used with Scope Domains, 'inner' scopes can be defined optionally by multiple definitions. |
| Filename | Denotes the actual source file as the scope. |
| Method | Denotes the actual method as the scope. |
| ThreadInner | Denotes the actual thread as the scope. When used with Scope Domains, 'inner' scopes can be defined optionally by multiple definitions. |
| Path | Denotes the actual source path as the scope. By adding positive integral values to this element (the enum type is an ALib arithmetical enum), 'outer' Scopes of this scope level itself can be defined using parent directories of the path. |
Definition at line 106 of file alox_init.inl.
|
strong |
Denotes flags used with methods void GetState(NAString&, StateInfo) and void State(const NString&, Verbosity, const String&, StateInfo) to select different parts of the state receive.
Definition at line 201 of file alox_init.inl.
|
strong |
Configuration variables uses by ALox.
| Enumerator | |
|---|---|
| NO_IDE_LOGGER | Denotes configuration variable ALOX/NO_IDE_LOGGER used by Log::AddDebugLogger. |
| CONSOLE_TYPE | Denotes configuration variable ALOX/CONSOLE_TYPE used by Lox::CreateConsoleLogger. |
| VERBOSITY | Denotes configuration variable ALOX/LOGGERNAME/VERBOSITY_WITH_LOXNAME. |
| SPTR_GLOBAL | Denotes configuration variable ALOX/GLOBAL_SOURCE_PATH_TRIM_RULES. |
| SPTR_LOX | Denotes configuration variable ALOX/LOXNAME/SOURCE_PATH_TRIM_RULES used by class Lox. |
| DOMAIN_SUBSTITUTION | Denotes configuration variable ALOX/LOXNAME/DOMAIN_SUBSTITUTION used by class Lox. |
| PREFIXES | Denotes configuration variable ALOX/LOXNAME/PREFIXES used by class Lox. |
| DUMP_STATE_ON_EXIT | Denotes configuration variable ALOX/LOXNAME/DUMP_STATE_ON_EXIT used by class Lox. |
| AUTO_SIZES | Denotes configuration variable ALOX/LOGGERNAME/AUTO_SIZES used by class TextLogger. |
| FORMAT | Denotes configuration variable ALOX/LOGGERNAME/FORMAT used by class TextLogger. |
| FORMAT_DATE_TIME | Denotes configuration variable ALOX/LOGGERNAME/FORMAT_DATE_TIME used by class TextLogger. |
| FORMAT_MULTILINE | Denotes configuration variable ALOX/LOGGERNAME/FORMAT_MULTILINE used by class TextLogger. |
| FORMAT_TIME_DIFF | Denotes configuration variable ALOX/LOGGERNAME/FORMAT_TIME_DIFF used by class TextLogger. |
| FORMAT_OTHER | Denotes configuration variable ALOX/LOGGERNAME/FORMAT_OTHER used by class TextLogger. |
| REPLACEMENTS | Denotes configuration variable ALOX/LOGGERNAME/REPLACEMENTS used by class TextLogger. |
| CONSOLE_LIGHT_COLORS | Denotes configuration variable ALOX/CONSOLE_LIGHT_COLORS used by colorful specializations of class TextLogger. |
| CODEPAGE | Denotes configuration variable ALOX/CODEPAGE used by the class WindowsConsoleLogger. |
Definition at line 19 of file aloxcamp.inl.
|
strong |
This enum is used in ALox to control the "verbosity" or "verboseness" of the log output. The values herein - apart from special value 'Off' - are sorted in the following order
A value of this set is provided to ALox in two different ways: First, all methods of class Lox that execute a log operation assign a value of this enum to the Log Statement. Secondly, the overloaded methods SetVerbosity, are defining the 'accepted' minimal Verbosity for a pair of <Logger/Log Domain>.
ALox, when executing a statement, checks both values against each other. A Log Statement is executed, when the <Logger/Log Domain> setting is set to the same or a 'higher level'. For example, if a <Logger/Log Domain> setting is Warning, then Log Statements with associated Verbosity Warning and Error are executed and those with Info and Verbose are suppressed.
If special value Off is used with Lox::SetVerbosity, all logging is switched off for this pair of <Logger/Log Domain>.
Some of the Log Statements accept the parameter directly (e.g. Entry, Lox::Once, and Lox::If), while others inherently use the right value as their method name suggests (e.g. Error, Warning, Info, Verbose and Assert). The latter group of methods do not support parameter Off.
If special value Off is used with those Log Statements, that allow to specify the Verbosity as a parameter, the Log Statement is never executed This is useful if the parameter is determined at run-time, depending on the state of an application.
Definition at line 51 of file alox_init.inl.
| void alib::lox::ALoxAssertionPlugin | ( | const lang::CallerInfo & | ci, |
| int | type, | ||
| std::string_view | domain, | ||
| std::string_view | msg ) |
This function will be set to global pointer PLUGIN when calling method static void AddDebugLogger(Lox*) .
If no debug-logging is used, or method AddDebugLogger is not used, then this function can also be used with a different Lox and explicitly activated using the static method static void SetALibAssertionPlugin(Lox*) . Uses internal domain "/ALIB" for logging, respectively to what the global variable ALOX_ASSERTION_PLUGIN_DOMAIN_PREFIX is set.
| ci | Information about the scope of invocation. |
| type | The type of the message. As a convention, 0 is an assertion, 1 is a warning, 2 is an info message, 3 or above are a verbose messages. |
| domain | The domain of the assertion, warning, or message. Will be appended to the ALox domain. |
| msg | The assembled message to print. |
| std::string_view const alib::lox::ALOX_ASSERTION_PLUGIN_DOMAIN_PREFIX = "/ALIB" |
The domain-prefix used with plug-in function ALoxAssertionPlugin. The given assertion domain will be appended to this name, separated by the domain separation character '/'.
Defaults to "ALIB".
|
extern |
The debug-lox instance. This object will be created in method void Bootstrap() override and deleted with void Shutdown(ShutdownPhases) override.