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()
 The creation time of the Logger.
 
Ticks TimeOfLastLog = new Ticks()
 Timestamp of the last log operation.
 
- Public Fields inherited from ThreadLock
int RecursionWarningThreshold =10
 
int waitWarningTimeLimitInMillis =1000
 

Public Methods

String GetName ()
 
String GetTypeName ()
 
abstract void Log (Domain domain, Verbosity verbosity, List< Object > logables, ScopeInfo scope)
 
override String ToString ()
 
- Public Methods inherited from SmartLock
 SmartLock ()
 
virtual int AddAcquirer (ThreadLock newAcquirer)
 
int CntAcquirers ()
 
virtual int RemoveAcquirer (ThreadLock acquirerToRemove)
 
- Public Methods inherited from ThreadLock
 ThreadLock (LockMode lockMode=LockMode.Recursive, Safeness safeness=Safeness.Safe)
 
virtual void Acquire ([CallerLineNumber] int cln=0,[CallerFilePath] String csf="",[CallerMemberName] String cmn="")
 
int DbgCountAcquirements (Thread thread=null)
 
LockMode GetMode ()
 
Safeness GetSafeness ()
 
virtual void Release ()
 
void SetSafeness (Safeness safeness)
 
override String ToString ()
 
bool WillRelease ()
 

Protected Fields

String Name
 
String TypeName
 
- Protected Fields inherited from SmartLock
List< ThreadLockacquirers =new List<ThreadLock>()
 
- Protected Fields inherited from ThreadLock
int cntAcquirements
 
LockMode lockMode
 
Object mutex
 
Thread owner
 
Ticks waitTime =new Ticks()
 

Protected Methods

 Logger (String name, String typeName)
 

Constructor & Destructor Documentation

◆ Logger()

Logger ( String  name,
String  typeName 
)
inlineprotected

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 ( )
inline

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 ( )
inline

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,
List< Object >  logables,
ScopeInfo  scope 
)
pure virtual

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.

Implemented in TextLogger.

◆ ToString()

override String ToString ( )
inline

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

Returns
A human readable string representation of this object.

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.

◆ 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: