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 | configCategoryName = 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 final String | INTERNAL_DOMAINS ="$/" |
static VariableDecl | MAX_ELAPSED_TIME |
static VariableDecl | PREFIXES |
static VariableDecl | REPLACEMENTS |
static final int | revision =0 |
static VariableDecl | USE_SYSTEM_OUT_PRINT |
static VariableDecl | VERBOSITY |
static final int | version =2402 |
Public Static Methods | |
static Lox | get (String name) |
static synchronized Lox | get (String name, Create create) |
static void | init () |
static void | init (Configuration config) |
static void | init (String[] args) |
static Verbosity | readVerbosity (Substring src) |
static synchronized void | register (Lox lox, ContainerOp operation) |
static void | reset () |
static AString | toString (Scope scope, int packageLevel, AString target) |
static AString | toString (Verbosity verbosity, int priority, AString target) |
Protected Static Fields | |
static boolean | isInitialized = false |
Private Static Fields | |
static ArrayList< Lox > | loxes = new ArrayList<Lox>() |
|
static |
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.
|
static |
Parameterless variant of method init. No command line args are set with default configuration.
true
if ALox was initialized before, false
if not.
|
static |
|
static |
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 Java method main() (the list of command line arguments). Accepts null to ignore command line parameters. |
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'. |
|
static |
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. |
|
static |
Resets this object. Concretely the following steps are performed:
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. |
|
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.configCategoryName.
|
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'
.
|
staticprotected |
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 Lox.
|
static |
Attributes of corresponding configuration variable used by TextLogger.
|
static |
|
static |
Attributes of corresponding configuration variable used by ConsoleLogger.
|
static |
Attributes of corresponding configuration variable ALOX_LOXNAME_LOGGERNAME_VERBOSITY.
|
static |
The version of ALox. The version number follows the scheme YYMM (2-digit year, 2-digit month) of the initial release date. Besides this version number, field revision indicates if this is a revised version of a former release.