ALox  V. 2402 R. 0
Home ALox for C++ ALox for C# ALox for Java Download
Public Fields | Public Methods | Protected Fields | Protected Methods | List of all members
Logger Class Referenceabstract
Inheritance diagram for Logger:
[legend]
Collaboration diagram for Logger:
[legend]

Class Description


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< ThreadLockacquirers = 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)
 

Constructor & Destructor Documentation

◆ Logger()

Logger ( String  name,
String  typeName 
)
protected

Constructs a logger.

Parameters
nameThe name of the Logger. If empty, it defaults to the type name. Will be converted to upper case.
typeNameThe type of the Logger. Will be converted to upper case.

Member Function Documentation

◆ getName()

String getName ( )

Returns the name of this logger. The name has to be unique for all Loggers attached to a Lox.

Returns
The loggers name.

◆ getTypeName()

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.

Returns
The loggers type name.

◆ log()

abstract void log ( Domain  domain,
Verbosity  verbosity,
ArrayList< Object >  logables,
ScopeInfo  scope 
)
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.

Parameters
domainThe Log Domain.
verbosityThe verbosity.
logablesThe list of objects to log.
scopeInformation about the scope of the Log Statement..

Reimplemented in TextLogger.

◆ toString()

String toString ( )

This is for debugging purposes. E.g. this enables the Eclipse IDE to display object descriptions in the debugger.

Returns
A human readable string representation of this object.

Reimplemented from ThreadLock.

Member Data Documentation

◆ cntLogs

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.

◆ name

String name
protected

The name of the Logger. Used as a reference to a logger. All loggers attached to a Lox have to differ in their names. If no name is specified with the constructor, the name will by the same as typeName.

◆ timeOfCreation

Ticks timeOfCreation = new Ticks()

The creation time of the Logger

◆ timeOfLastLog

Ticks timeOfLastLog = new Ticks()

Timestamp of the last log operation

◆ typeName

String typeName
protected

The type name of the Logger. This is set by the derived class similar to the class name.


The documentation for this class was generated from the following file: