This is a 100% static class that holds constants and 'global' methods of the ALox Logging Library.
Public Static Fields | |
static VariableDecl | AUTO_SIZES |
static Configuration | Config =null |
static AString | ConfigCategory = new AString("ALOX" ) |
static VariableDecl | CONSOLE_LIGHT_COLORS |
static VariableDecl | CONSOLE_TYPE |
static VariableDecl | DOMAIN_SUBSTITUTION |
static VariableDecl | DUMP_STATE_ON_EXIT |
static VariableDecl | FORMAT |
static VariableDecl | FORMAT_DATE_TIME |
static VariableDecl | FORMAT_MULTILINE |
static VariableDecl | FORMAT_TIME_DIFF |
static readonly String | InternalDomains ="$/" |
static VariableDecl | MAX_ELAPSED_TIME |
static VariableDecl | NO_IDE_LOGGER |
static VariableDecl | PREFIXES |
static VariableDecl | REPLACEMENTS |
static readonly int | Revision =0 |
static VariableDecl | SPTR_GLOBAL |
static VariableDecl | SPTR_LOX |
static VariableDecl | VERBOSITY |
static readonly int | Version =2402 |
Public Static Methods | |
static Lox | Get (String name, Create create=Create.Never) |
static void | Init (Configuration config) |
static void | Init (String[] args=null) |
static Verbosity | ReadVerbosity (Substring src) |
static void | Register (Lox lox, ContainerOp operation) |
static void | Reset () |
static AString | ToString (Scope scope, int pathLevel, AString target) |
static AString | ToString (Verbosity verbosity, int priority, AString target) |
static AString | ToStringPriority (int priority, AString target) |
Private Static Fields | |
static bool | isInitialized = false |
static List< Lox > | loxes = new List<Lox>() |
Returns the Lox with the given name. A lox is only found if it was created and registered with ALox using Register. If not found, and parameter create is true
(the default), a new Lox is created, registered and returned.
name | The name of the Lox to search and optionally to create. Comparison is case insensitive. |
create | Denotes whether a Lox that was not found is created. Optional and defaults to Create.Never. |
null
in case of failure.
|
inlinestatic |
|
inlinestatic |
This method must be called prior to using ALox, e.g. at the beginning of the main()
method of an application. It is OK, to call this method more than once, which allows independent code blocks (e.g. libraries) to bootstrap ALox independently. However, only the first invocation is effective.
The very first invocation should not be interrupted by a parallel invocation of a second thread. Consequently, with more complex applications it is recommended to explicitly invoke this method once when the software is bootstrapped.
If command line parameters should be used for configuring ALox, then the very first call to this method has to provide the argc and argv parameters. Subsequent calls to this method with different parameters do not change the setup.
If other, custom configuration data sources should be used already with this method (to read the configuration variables as described in ALIB.Init), use overloaded method ALox.Init(Configuration).
args | Parameters taken from standard C# method main() (the list of command line arguments). Defaults to null. |
Interprets given src as a verbosity. A case insensitive comparison of only the first (!) character of the start of the string is performed (against 'v', 'i', 'w' and 'e'). If no match is found, Verbosity.Off is returned.
src | The string to 'parse'. |
|
inlinestatic |
Registers or un-registers a Lox object statically with ALox. Once registered, any code entity of the same process is enabled to retrieve the Lox using Get.
No two objects with the same name must be registered. If this is done, the latter will not be registered and not be found by Get. In debug-compilations, an ALib error report is written (by default raises 'assert') if a name is registered twice.
Note that name comparison is performed case in-sensitive.
If debug-logging is enabled (depends on compilation symbols) and used, the singleton of type % Lox provided for debug-logging is registered. This uses the name "Log"
Registration is not mandatory but done by default by the constructor of class Lox. Therefore, to keep a Lox private, an optional parameter is available.
lox | The Lox to register. |
operation | If ContainerOp.Remove, the given Lox is deregistered. Defaults to ContainerOp.Insert. |
|
inlinestatic |
Resets this object. Concretely the following steps are performed:
Provides a string representation of the Scope enums.
scope | The enum value to retrieve a string representation for. |
pathLevel | The path level. |
target | The target string. |
Writes a string representation of the Verbosity and priority into the given AString.
verbosity | The enum value to retrieve a string representation for. |
priority | The priority of the verbosity setting. |
target | The target to write into. |
Writes a string representation of the priority value into the given AString.
priority | The priority of the verbosity setting. |
target | The target to write into. |
|
static |
Attributes of corresponding configuration variable used by TextLogger.
|
static |
The configuration used by ALox. This is received or created with overloaded Init methods. It might be shared with other libraries or can be an instance explicitly dedicated to the ALox library.
The option to use an exclusive one may be used to store ALox configuration variables in different configuration files, e.g. to reduce "clutter" of an applications' then "main" configuration file.
Changes should only be made at very initial, single threaded bootstrap code, with the invocation of the according method Init(Configuration).
The name of the configuration category of configuration variables used by ALox.
Defaults to "ALOX".
This value can be changed to avoid conflicts between applications (especially in respect to environment variable settings). Changes should be placed at very initial bootstrap code, before the invocation of Init.
See also ALIB.ConfigCategory.
|
static |
Attributes of corresponding configuration variable used by colorful specializations of class TextLogger.
|
static |
Attributes of corresponding configuration variable used by Lox.CreateConsoleLogger.
|
static |
Attributes of corresponding configuration variable used by Lox.
|
static |
Attributes of corresponding configuration variable used by Lox.
|
static |
Attributes of corresponding configuration variable used by TextLogger.
|
static |
Attributes of corresponding configuration variable used by TextLogger.
|
static |
Attributes of corresponding configuration variable used by TextLogger.
|
static |
Attributes of corresponding configuration variable used by TextLogger.
|
static |
This is the path for logging to the internal domain. By manipulating this Log Domain's Verbosity, the verbosity of ALox itself can be controlled. For example, with Verbosity.INFO, the 'on the fly' creation of Log Domains are logged, which can be helpful to determine the Log Domains that are created by libraries and larger projects.
The following sub-domains are used by ALox:
Sub-Domain | Description |
---|---|
LGR | Used when Loggers are registered, retrieved or removed from a Lox and when the Verbosity of a Log Domain for a Logger is changed. In addition used with method Lox.SetStartTime. |
DMN | Used when Log Domains are registered (on first use), when Scope Domains are set or removed and when Domain Substitution Rules are set. |
PFX | Used when Prefix Logables are set or removed. |
THR | Used with method Lox.MapThreadName. |
LGD | Used with storing and retrieving Log Data objects. |
In addition, class ALoxReportWriter logs into sub-domain 'REPORT'
.
|
staticprivate |
State of initialization, used to avoid double initialization.
|
static |
Attributes of corresponding configuration variable used by TextLogger.
|
static |
Attributes of corresponding configuration variable used by Log.AddDebugLogger.
|
static |
Attributes of corresponding configuration variable used by Lox.
|
static |
Attributes of corresponding configuration variable used by TextLogger.
|
static |
|
static |
Attributes of corresponding configuration variable ALOX_GLOBAL_SOURCE_PATH_TRIM_RULES.
|
static |
Attributes of corresponding configuration variable used by Lox.
|
static |
Attributes of corresponding configuration variable ALOX_LOXNAME_LOGGERNAME_VERBOSITY.
|
static |