This is central class of the ALox logging implementation. It is not recommended to use this class directly for logging. Instead, use the simple and convenient static interface class Log or, for release logging and other more complex operations use a Lox instance. The class is abstract. To implement an own log stream, derive a new Logger class and implement the abstract method log.
Public Fields | |
int | cntLogs |
Ticks | timeOfCreation = new Ticks() |
Ticks | timeOfLastLog = new Ticks() |
Public Fields inherited from ThreadLock | |
int | recursionWarningThreshold = 10 |
int | waitWarningTimeLimitInMillis = 1000 |
Public Methods | |
String | getName () |
String | getTypeName () |
abstract void | log (Domain domain, Verbosity verbosity, ArrayList< Object > logables, ScopeInfo scope) |
String | toString () |
Public Methods inherited from SmartLock | |
SmartLock () | |
int | addAcquirer (ThreadLock newAcquirer) |
int | cntAcquirers () |
int | removeAcquirer (ThreadLock acquirerToRemove) |
Public Methods inherited from ThreadLock | |
ThreadLock () | |
ThreadLock (LockMode lockMode) | |
ThreadLock (LockMode lockMode, Safeness safeness) | |
void | acquire () |
int | dbgCountAcquirements (Thread thread) |
LockMode | getMode () |
Safeness | getSafeness () |
void | release () |
void | setSafeness (Safeness safeness) |
boolean | willRelease () |
Protected Fields | |
String | name |
String | typeName |
Protected Fields inherited from SmartLock | |
ArrayList< ThreadLock > | acquirers = new ArrayList<ThreadLock>() |
Protected Fields inherited from ThreadLock | |
int | cntAcquirements |
boolean | createOwnerStackTrace = false |
LockMode | lockMode |
Object | mutex |
Thread | owner |
Exception | ownerException |
Ticks | waitTime = new Ticks() |
Protected Methods | |
Logger (String name, String typeName) | |
Additional Inherited Members | |
Package Access Methods inherited from ThreadLock | |
void | constructor (LockMode lockMode, Safeness safeness) |
|
protected |
String getName | ( | ) |
Returns the name of this logger. The name has to be unique for all Loggers attached to a Lox.
String getTypeName | ( | ) |
Returns the constant type name of this logger. The type name is defined by the class and hence provides a sort of runtime type information.
|
abstract |
This is the central method that derived logger classes have to implement to log a message. When it is invoked the Log Domain's Verbosity was already checked against parameter verbosity. The only action to take is to perform the log itself.
Parameter logables contains at least one object, the one provided with the log statement. Other objects that might be included in the list, are Prefix Objects corresponding to the scope.
domain | The Log Domain. |
verbosity | The verbosity. |
logables | The list of objects to log. |
scope | Information about the scope of the Log Statement.. |
Reimplemented in TextLogger.
String toString | ( | ) |
This is for debugging purposes. E.g. this enables the Eclipse IDE to display object descriptions in the debugger.
Reimplemented from ThreadLock.
int cntLogs |
The number of logs actually performed so far. In a text logger this is similar to the line number, despite the fact that a single log call can produce more than one line.
|
protected |
|
protected |
The type name of the Logger. This is set by the derived class similar to the class name.