ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
ALox Configuration Variables

Description

Trough the use of camp module ALib Configuration of the ALib C++ Library, external configuration variables can be comfortably defined and accessed.

While this is a reference appendix chapter, for general information, please refer to:

A few further configuration variables that ALib internally uses are defined by module ALib BaseCamp. The variables defined with that module are documented here.

Default Behavior:

ALox and the ALib C++ Library are designed to run fine without setting configuration variables, because all of them have resourced default values. Therefore, these variables provide an additional way to tweak ALox and change its default behavior.

Declaration:

The variables listed here are resourced with camp ALox and declared with enum class lox::Variables.

Note
Setting environment variables is platform-specific and is not part of this documentation. To get an overview, refer to Wikipedia.

Variable Index

Reference Documentation

ALOX/CONSOLE_TYPE

Type: "S" (AStringPA) Default Value: "default"

Influences the type of console logger that will be created by method Lox::CreateConsoleLogger, which is also used by Log::AddDebugLogger.

Possible values are:

Value
Effect
Default No influence, same as if variable was not set (An OS-specific, colorful logger is chosen).
Plain Plain text Logger of type ConsoleLogger is created.
Ansi A Logger of type AnsiLogger is created.
Windows A Logger of type WindowsConsoleLogger is created.

ALOX/CONSOLE_LIGHT_COLORS

Type: "ALOXCLP" (ColorfulLoggerParameters) Default Value: "Auto"

Evaluated by colorful loggers that dispose about light and dark colors to adjust their foreground color accordingly. E.g., for instances of class AnsiLogger, field CFP is set.

If not given, under Windows OS the right value is detected (here, the color of a terminal is detectable). Otherwise the value defaults to be an empty string, which chooses a programmatically evaluated (internal) default value. In some occasions the (detected or set) runtime environment might influence such default value.

Value options are:

  • "Foreground": Sets the foreground color to a light color. This is recommended if for consoles with dark background.
  • "Background": Sets the background color to a light color. This is recommended if for consoles with a light background.
  • "Never": Sets foreground and background color to the same "brightness". This is recommended solely for systems that do not support light colors.

ALOX/NO_IDE_LOGGER

Type: "B" (boolean) Default Value: "false"

Boolean variable that is evaluated in method Log::AddDebugLogger. If not set, when debugging, an additional Logger supporting the log output of the IDE is created. The only logger currently available (needed) is with WindowsOS / VisualStudio, class VStudioLogger.

This variable can be used to suppress this.

ALOX/CODEPAGE

Type: "I" (integral) Default Value: 65001
Availability: On target platform WindowsOS only.

Evaluated once in the constructor of class WindowsConsoleLogger. Overwrites the default value of field CodePage. For possible values refer to [Microsoft documentation] (https://msdn.microsoft.com/EN-US/library/windows/desktop/dd317756%28v=vs.85%29.aspx).

ALOX/LOGGERNAME/AUTO_SIZES

Type: "ALOXAS" (FormatAutoSizes) Default Value: none.

Format: ALOX/<LOGGERNAME>/AUTO_SIZES = [!] [ T|F Actual[,session] ] [/ T|F Actual[,session] ] [; [!] [ T|F Actual[,session] ] [/ T|F Actual[,session] ] ]

While the format definition above looks rather complicated, in fact it is just two optional exports auf the contained AutoSizes objects, separated by a semicolon ';'.

This variable is used by Loggers derived from abstract type TextLogger. It is read when a TextLogger is registered with a Lox.
This mechanism maintains automatically adjusted tabulator positions in the generated meta information across different runs of a software.

Note that the portion 'LOGGERNAME' in the variable name is replaced by ALox with the value of Logger::GetName. This allows having different sizes for different Loggers.

Consider this variable a 'cookie' that ALox uses to store tabulator widths which automatically increase as needed, across sessions.

Note
Being a pure convenience feature that optimizes the log output slightly, this variable is considered a "session variable" in contrast to a real "configuration variable". Consequently the variable is defined with Priority::Session when written by a TextLogger. More information on this difference and how to best store this variable is given with chapter 7.5 Writing Session Information of the Programmer's Manual of module ALib Configuration.

The value of the variable can be retrieved with TextLogger::GetAutoSizes. If a certain set auf sizes is to be used and never changed, then flags AutoSizes::WriteProtected can be set in one or both AutoSizes instances of this variable. The flag will also be set by the logger, if the configuration variable becomes defined with a priority higher than Priority::Session.

See also

ALOX/LOGGERNAME/FORMAT

Type: "ALOXFMI" (FormatMetaInfo) Default Value: "%SF:%SL:%A3%SM %A3[%TC +%TL][%tN][%D]%A1#%# %V: ,[ERR],[WRN], ,[***]".

This variable is used by Loggers derived of type textlogger::TextLogger.
It is read when a Logger of that type is added to a Lox and if found, fields

of struct FormatMetaInfo are set according to the variables' content. The contents of the variable is specified as follows:

Format: ALOX/<LOGGERNAME>/FORMAT = ["]Format["] [, ["]Error["] [, ["]Warning["] [, ["]Info["] [, ["]Verbose["] ] [, ["]MsgSuffix["] ]]]]]

Values that start or end with whitespace characters or which contain comma characters (,) , need to be enclosed by quotation marks (").

Note that the portion 'LOGGERNAME' in the variable name is replaced by ALox as follows:

This allows configuring either a single Logger or a whole class of Loggers.

As a sample, configuration variable ALOX/ANSI_CONSOLE_LOGGER/FORMAT, affects all loggers of type AnsiConsoleLogger as long as no specific name is set when such Logger is constructed and no separate configuration for that name is set.

Note that the default debug Logger which is automatically created if no Logger is attached to the debug Lox singleton, is named "DEBUG_LOGGER". Therefore, by setting variable ALOX/DEBUG_LOGGER/FORMAT, this Logger is affected. Furthermore, with debugging, a second debug-Logger for the IDE might be created (depending on the platform and IDE used). Its' name is "IDE_LOGGER".

ALOX/LOGGERNAME/FORMAT_DATE_TIME

Type: "ALOXFDT" (FormatDateTime) Default Value: "yyyy-MM-dd,HH:mm:ss, Days ".

This variable is used and applied in the same way as ALOX/LOGGERNAME/FORMAT and the fields of struct FormatDateTime:

ALOX/LOGGERNAME/FORMAT_TIME_DIFF

Type: "ALOXFTD" (FormatTimeDiff) Default Value: "1000,--- , ns, \\u00B5s, ms, s, m, h, days".

This variable is used and applied in the same way as ALOX/LOGGERNAME/FORMAT and the fields of struct FormatTimeDiff:

ALOX/LOGGERNAME/FORMAT_MULTILINE

Type: "ALOXFML" (FormatMultiLine) Default Value: "2,ALox: Multi line message follows: ,> ,,nulled,\\r".

This variable is used and applied in the same way as ALOX/LOGGERNAME/FORMAT and the fields of struct FormatMultiLine:

ALOX/LOGGERNAME/FORMAT_OTHER

Type: "ALOXFO" (FormatOther) Default Value: "---, ---, 3".

This variable is used and applied in the same way as ALOX/LOGGERNAME/FORMAT and defines the fields of struct FormatOther:

ALOX/LOGGERNAME/VERBOSITY_WITH_LOXNAME

Type: "SV;" (StringVectorSemicolon) Default Value: none.

This variable is used to set Verbosities for a Logger attached to an instance of class Lox. The portions 'LOGGERNAME' and 'LOXNAME' of the variable name have to be replaced by the names of the instances of Lox and Logger in question.

Format: ALOX/<LOGGERNAME>/VERBOSITY_WITH_<LOXNAME> = [ExportAll ;] [*]domainpath[*] = verbosity [ ; … ]

Details are described in chapter 13.4 Variable LOXNAME_LOGGERNAME_VERBOSITY of the Programmer's Manual.

ALOX/LOGGERNAME/REPLACEMENTS

Type: "S" (AStringPA) Format: ALOX/<LOGGERNAME>/REPLACEMENTSFORMAT = , ["]search["]=["]replace["] [, ...]

Note that the portion 'LOGGERNAME' in the variable name is replaced as documented in ALOX/LOGGERNAME/FORMAT.

The variable allows setting pairs of search and replace strings for a text logger. Pairs found here, are set using method TextLogger::SetReplacement.

Values that start or end with whitespace characters or which contain comma characters (,), need to be enclosed by quotation marks (").

ALOX/LOXNAME/DOMAIN_SUBSTITUTION

Type: "SV;" (StringVectorSemicolon) Default Value: none.
This variable is used to define Domain Substitution Rules for a Lox. The portion 'LOXNAME' of the variable name has to be replaced by the name of the instance of class Lox in question.

Format: ALOX/<LOXNAME>/DOMAIN_SUBSTITUTION = [*]domainpath[*] -> replacement [ ; … ]

Details are described in Substitution Rules and External Configuration.

ALOX/GLOBAL_SOURCE_PATH_TRIM_RULES

Type: "S" (AStringPA) Default Value: "" (empty string).

This variable is used to define global Source Path Trim Rules.

Format: ALOX/GLOBAL_SOURCE_PATH_TRIM_RULES = [*]sourcepath [, inclusion, trimoffset, sensitivity, replacement] [ ; … ]

Details are described in External Configuration of Trim Rules.

ALOX/LOXNAME/SOURCE_PATH_TRIM_RULES

Type: "S" (AStringPA) Default Value: "" (empty string).

This variable is used to define Lox-specific Source Path Trim Rules. The portion 'LOXNAME' of the variable name has to be replaced by the name of the instance of class Lox in question.

Format: ALOX/<LOXNAME>/SOURCE_PATH_TRIM_RULES = [*]sourcepath [, inclusion, trimoffset, sensitivity, replacement] [ ; … ]

Details are described in External Configuration of Trim Rules.

ALOX/LOXNAME/PREFIXES

Type: "S" (AStringPA) Default Value: "" (empty string).

This variable is used to define Lox and Log Domain specific Prefix Logables (strings only). The portion 'LOXNAME' of the variable name has to be replaced by the name of the instance of class Lox in question.

Format: ALOX/<LOXNAME>/PREFIXES = [*]domainpath[*] = prefixstring [, inclusion] [ ; … ]

The variable value may contain more than one definition, separated by semicolons ';'. Each definition contains of the following parameters:

  • domainpath
    An absolute or relative domain path. When using the optional asterisk characters '*', a start of a domain path, the end of a domain path or an arbitrary substring of a domain path can also be denoted. This way, more than one Log Domain might be affected.
  • prefixstring
    The Prefix Logable to set. The string is trimmed from whitespaces unless surrounded by quotation marks, ". Outer quotation marks are trimmed as well.
  • inclusion
    Can evaluate to the terms Include or Exclude. Can be arbitrarily abbreviated (i.e. "E" is enough) and is read in case insensitive way. The meaning is the same as parameter otherPLs of method alib::lox::Lox::SetPrefix( const Box&, const NString&, lang::Inclusion otherPLs= lang::Inclusion::Include) "Lox::SetPrefix".

ALOX/LOXNAME/DUMP_STATE_ON_EXIT

Type: "S" (AStringPA) Default Value: "none, verbosity=info, domain=/ALOX" (empty string).

Used for debugging or for investigation into ALox enabled 3rd party libraries or applications.

Note
If you want to prevent such investigation for your software, refer to the documentation of module ALib Configuration to learn how to protect external variables from being set.

Format: ALOX/<LOXNAME>/DUMP_STATE_ON_EXIT = arg1 [, arg2][, … ]

The portion 'LOXNAME' of the variable name has to be replaced by the name of the instance of class Lox in question.

If this variable is defined, class Lox will automatically invoke method Lox::State at the moment a first Logger is removed. In most cases this would be the at the end of the process. (The other cases are: If after a removal of a Logger, the same or another Logger is added, then the next removal of a Logger will again invoke the method.)

There are two types of arguments possible which can appear in arbitrary order. All argument identifiers are letter case agnostic.

1. State Information Flags:
See reference documentation of Lox::State for more information. The identifiers expected in this variables' arguments are: ww

Identifier
Description
None Selects nothing. This identifier overrules all others. If found, nothing is done.
All Selects everything
Basic Name of the Lox and number of log calls
Version Library version and thread-safeness
Loggers Loggers
Domains Log domains currently registered
Internaldomains Internal domains
Scopedomains Scope domains
DSR Domain substitution rules
PrefixLogables Prefix logables
Once Log once counters
Logdata Log data objects
Threadmappings Named threads
SPTR Source path trim rules (C++ and C# only)
Compilationflags ALib compilation flags (C++ only)


2. Attributes:
Two attributes that are affecting the invocation of Lox::State can be provided as arguments:

Attribute
Description
domain = DOMAIN_PATH Sets a domain path for the Log.State invocation (defaults to "").
verbosity = VERBOSITY Sets a verbosity for the Log.State invocation (defaults to "Info").

As a sample, take the following external variable:

    ALOX/LOG_DUMP_STATE_ON_EXIT= domain=/DEBUG, verbosity = info,  logdata, scopedomains

When the process terminates (precisely the first Logger is removed from the standard debug Lox instance), then method Lox::State is invoked, with

  • absolute domain '/DEBUG' provided for parameter domain,
  • value Verbosity.Info for parameter verbosity and
  • parameter flags set to ( LogData & ScopeDomains )